|
Group: Forum Members
Posts: 14,
Visits: 1
|
Hi,
I'm working on enabling users to select all shapes that have child shapes, in an organization chart. So basically, all the manager shapes. I need to be able to iterate through the shapes and select only the parents.
I tried the code below but for some reason the doc.ActiveLayer.Children(NFilters.Shape2D) never returns any shapes. I use similar code (from your example app) to add expand/collapse decorators and it works fine. That code is not in a sub being called from a button however, it's in the load event. Would that matter?
Public Sub SelectSumTasks(ByVal doc As NDrawingDocument, ByVal view As NDrawingView) Dim selection As NSelection = View.Selection ' select all summary task shapes so user can edit as a group For Each shape As NShape In doc.ActiveLayer.Children(NFilters.Shape2D) If shape.GetOutgoingShapes().Count = 0 Then Continue For End If
' create the decorators collection 'shape.CreateShapeElements(ShapeElementsMask.Decorators) selection.MultiSelect(shape)
Next shape End Sub
Thanks for any help, Eric
|