In Unigraphics, there are two files which are especially for programmers.
- The .net reference, in the folder %UGDir\UGDOC\html_files\nxopen_net_ref.chm, which contains all the class references;
- The .net programming guide, in the folder %UGDir\UGDOC\html_files\nxopen_net_ref\index.htm .
The 2nd is esp. useful at the initial programming stages.
For instance, in the programming guide, it is clearlly noted the methods of retrieving the entities:
NX session → list of parts
part → list of solid bodies
solid body → list of faces
solid body → list of edges
face → list of associated edges
face → solid body
edge → list of associated faces
edge → solid body
Using this, it is very easy to access the entities:
theSession = Session.GetSession();
PartCollection sessionParts = theSession.Parts;
foreach (Part p in sessionParts)
TreeNode PartNode =new TreeNode(p.Leaf);
foreach (Body body in p.Bodies)
TreeNode BodyNode=new TreeNode(body.JournalIdentifier);
BodyNode.Tag = body;