Smart Art をグループ シェイプに変換する

考えられる使用シナリオ

を使用してスマート アート シェイプをグループ シェイプに変換できます。Shape.GetResultOfSmartArt()方法。グループシェイプのようなスマートなアートシェイプを扱えるようになります。したがって、グループ シェイプの個々のパーツまたはシェイプにアクセスできます。

Smart Art をグループ シェイプに変換する

次のサンプル コードは、サンプル Excel ファイルこのスクリーンショットに示すように、スマート アート シェイプが含まれています。次に、スマート アート シェイプをグループ シェイプに変換し、Shape.IsGroup プロパティを出力します。以下に示すサンプル コードのコンソール出力を参照してください。

todo:画像_代替_文章

サンプルコード

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
//Load the sample smart art shape - Excel file
Workbook wb = new Workbook("sampleSmartArtShape_GetResultOfSmartArt.xlsx");
//Access first worksheet
Worksheet ws = wb.Worksheets[0];
//Access first shape
Shape sh = ws.Shapes[0];
//Determine if shape is smart art
Console.WriteLine("Is Smart Art Shape: " + sh.IsSmartArt);
//Determine if shape is group shape
Console.WriteLine("Is Group Shape: " + sh.IsGroup);
//Convert smart art shape into group shape
Console.WriteLine("Is Group Shape: " + sh.GetResultOfSmartArt().IsGroup);

コンソール出力

Is Smart Art Shape: True

Is Group Shape: False

Is Group Shape: True