Konvertieren Sie die Smart Art in eine Gruppenform
Contents
[
Hide
]
Mögliche Nutzungsszenarien
Sie können Smart Art Shape mithilfe von in Group Shape umwandelnShape.GetResultOfSmartArt()Methode. Es ermöglicht Ihnen, Smart Art Shape wie eine Gruppenform zu handhaben. Folglich haben Sie Zugriff auf die einzelnen Teile oder Formen der Gruppenform.
Konvertieren Sie die Smart Art in eine Gruppenform
Der folgende Beispielcode lädt dieBeispiel-Excel-Dateimit einer intelligenten Kunstform, wie in diesem Screenshot gezeigt. Anschließend wird die SmartArt-Form in eine Gruppenform konvertiert und die Shape.IsGroup-Eigenschaft gedruckt. Bitte sehen Sie sich die Konsolenausgabe des unten angegebenen Beispielcodes an.
Beispielcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
Konsolenausgabe
Is Smart Art Shape: True
Is Group Shape: False
Is Group Shape: True