スマートアートをグループ形状に変換

可能な使用シナリオ

Smart Art ShapeをGroup Shapeに変換するには、Shape.GetResultOfSmartArt()メソッドを使用します。これにより、スマートアートの形状をグループ形状として扱えるようになります。それにより、グループ形状の個々の部分または形状にアクセスできるようになります。

スマートアートをグループシェイプに変換する

以下のサンプルコードは、スマートアートシェイプを含むsample Excel fileをロードし、画像のスクリーンショットに示されているように、スマートアートシェイプをグループ形状に変換し、Shape.IsGroupプロパティを出力します。以下は、サンプルコードのコンソール出力です。

todo:image_alt_text

サンプルコード

// 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