Convert the Smart Art to Group Shape

Possible Usage Scenarios

You can convert Smart Art Shape into Group Shape using the Shape.getResultOfSmartArt() method. It will enable you to handle smart art shape like a group shape. Consequently, you will have access to the individual parts or shapes of the group shape.

Convert the Smart Art to Group Shape

The following sample code loads the sample Excel file containing a smart art shape as shown in this screenshot. It then converts the smart art shape into group shape and prints the Shape.IsGroup property. Please see the console output of the sample code given below.

todo:image_alt_text

Sample Code

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
//Load the sample smart art shape - Excel file
Workbook wb = new Workbook("sampleSmartArtShape_GetResultOfSmartArt.xlsx");
//Access first worksheet
Worksheet ws = wb.getWorksheets().get(0);
//Access first shape
Shape sh = ws.getShapes().get(0);
//Determine if shape is smart art
System.out.println("Is Smart Art Shape: " + sh.isSmartArt());
//Determine if shape is group shape
System.out.println("Is Group Shape: " + sh.isGroup());
//Convert smart art shape into group shape
System.out.println("Is Group Shape: " + sh.getResultOfSmartArt().isGroup());

Console Output

Is Smart Art Shape: true

Is Group Shape: false

Is Group Shape: true