Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Getting the part name

Status
Not open for further replies.

SaUt1

Industrial
Joined
Jul 28, 2014
Messages
3
Location
DE
Hi!

I have an Object that includes different parts. How is it possible to get those parts names?
A Little example:

theSession = Session.GetSession()
workPart = theSession.Parts.Work
displayPart = theSession.Parts.Display
MsgBox(workPart.name)

Thank you very much!
 
Thank you very much for your response! I am using NX as a Virtual Application, therefore debugging with VB using NX is not possible. I have problems understanding the class hierarchy, for example I need to get the parent of a part. In Catia I have the option to directly access the parent with product.parent or product.parent.parent. Does a documentation of the class hierarchy exist online for free?
 
In the NX object model there are part objects and component objects (among many others); parts do not have parents, components do. If you have a reference to a component, you can use compRef.Parent, which will return another component reference (the parent) or a null reference (the component doesn't have a parent, or it is not loaded in session).

If you have a reference to a part object, you can use the .ComponentAssembly property to query what components the part references, if any.

If you have a valid NX license, you can download the help files (if you don't have them already) from the GTAC website.

www.nxjournaling.com
 
Thank you for your answer.
I am finaly able now to use the Debugger. I saw that there is the Option "OwningComponent" and "DirectOwner". What is the difference between parent and that?
 
In the context of components, .OwningComponent and .Parent are essentially the same, they both return a reference to a Component object (the next level up, if there is one); .DirectOwner will return a reference to the ComponentAssembly object that the component belongs to.

www.nxjournaling.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top