Remove node or sub node
[C#]
PresentationEx pres = new PresentationEx("demo.pptx");
SmartArtEx smart = (SmartArtEx) pres.Slides[0].Shapes[0];
if (smart.AllNodes.Count > 0 )
{
SmartArtNodeEx node = smart.AllNodes[0];
smart.AllNodes.RemoveNode(node);
}
[Visual Basic]
Dim pres As New PresentationEx("demo.pptx")
Dim smart As SmartArtEx = DirectCast(pres.Slides(0).Shapes(0), SmartArtEx)
If smart.AllNodes.Count > 0 Then
Dim node As SmartArtNodeEx = smart.AllNodes(0)
smart.AllNodes.RemoveNode(node)
End If
Remove node from selected position
[C#]
SmartArtEx smart = pres.Slides[0].Shapes.AddSmartArt(0, 0, 400, 400, SmartArtLayoutTypeEx.StackedList);
SmartArtNodeEx node = smart.AllNodes[0];
if (node.ChildNodes.Count >=5)
{
node.ChildNodes.RemoveNodeByPosition(3);
}
[Visual Basic]
Dim smart As SmartArtEx = pres.Slides(0).Shapes.AddSmartArt(0, 0, 400, 400, SmartArtLayoutTypeEx.StackedList)
Dim node As SmartArtNodeEx = smart.AllNodes(0)
If node.ChildNodes.Count >= 5 Then
node.ChildNodes.RemoveNodeByPosition(3)
End If