Getting child nodes of node in diagram


Author
Message
yoav Roytenberg
yoav Roytenberg
Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)
Group: Forum Members
Posts: 13, Visits: 1
Hi,

I have managed to create a diagram using shapes and edges.
for each shape i create, i do:

/// Create an edge connecting shpaes in the tree diagram
///
private void CreateEdge(NShape parentShape, NShape childShape)
{
NRoutableConnector edge = new NRoutableConnector();
edge.ConnectorType = RoutableConnectorType.DynamicPolyline;
edge.StyleSheetName = "CustomConnectors";
document.ActiveLayer.AddChild(edge);
edge.FromShape = parentShape;
edge.ToShape = childShape;
}

When a certain shape is given, how can I get to its child shapes?
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi, you can easily get the childs of any node using the following piece of code:

NShape shape = (NShape)document.ActiveLayer.GetChildByName(shapeName);
NNodeList children = shape.GetDestinationShapes();



Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search