Determine if Shape is Smart Art Shape

Possible Usage Scenarios

Smart Art Shapes are special shapes in Microsoft Excel that allow you to create complex diagrams automatically. You can find if the shape is a smart art shape or normal shape using Shape.IsSmartArt property.

Determine if Shape is Smart Art Shape

The following sample code loads the sample Excel file containing a smart art shape as shown in this screenshot. It then prints the value of Shape.IsSmartArt property of the first shape. 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.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());

Console Output

Is Smart Art Shape: true