Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NX Open question- Tree list 1

Status
Not open for further replies.

nastranuser123

Structural
Oct 17, 2013
23
I have created a Tree list through NX Open API's

I am able to get selected nodes from Tree List using API tree_control0->GetSelectedNodes();

I need to get the nodes which are displayed in treelist without selecting i.e., want to get all the nodes displayed in treelist.

Can anyone please help?

 
Replies continue below

Recommended for you

If I recall correctly the process you have to use is as follows:
[ol 1]
[li]Find the first root node of the Tree using tree.rootNode()[/li]
[li]Ask for the sibling nodes of the first root node using node.nextSiblingNode()[/li]
[/ol]
If you then want to find all nodes you have to recursively do the above for all the root nodes you found, but instead of calling tree.rootNode() call node.firstChildNode(). You can then call node.nextSiblingNode().

I don't think there is a convenience method to just get all the nodes in one go because there is no easy way to represent the hierarchy of nodes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor