cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between Part, BasePart and Component

Builder
Builder

Hello everybody. I am new to programming with UG. I was wondering what the difference between a Part, component, and basepart? Any feedback is greatly appreciated.

6 REPLIES

Re: Difference between Part, BasePart and Component

Phenom
Phenom

If you check the help file for "basepart", the inheritance hierarchy shows that "part" and "CAEpart" inherit from "basepart". In programmer lingo, the base part is the parent class (or super class); part and caepart are child classes (or sub classes). What this means is the basepart class defines all the properties and methods common to all part classes. Part and CAEpart extend basepart to add their own unique properties and methods.

 

For example, the .Expressions collection is defined in the basepart class so no matter what type of part you have a reference for, you can access the Expressions collection. However, you can only access the .Bodies collection if you have a reference to a "part" (not basepart or CAEpart). Similarly, you can only access the .CAEGroups if you have a reference to a CAEpart variable.

 

A component is an instance of a part in the context of an assembly. Let's say you have an assembly of a car. You would make one "wheel" model then add it to your car assembly four times. Each component is an instance of the wheel model. The assembly treats each instance individually; you can orient each instance independently, rename each instance, assign unique attributes to each instance, etc etc.

 

Every part has a .ComponentAssembly property (inherited from the basepart class definition) to manage its components.

Re: Difference between Part, BasePart and Component

Builder
Builder
Excellent that makes a lot of sense thank you.
Also what is the .prototype?
Confused about that as well
CONFIDENTIALITY WARNING: This email communication and any attachments contain privileged and confidential information intended only for the use of the intended recipient. If the reader of this communication is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution, use or reproduction of this communication or its attached contents is prohibited. If you have received this communication in error, please notify us immediately by return email and delete this message and any attachment from your system.

Re: Difference between Part, BasePart and Component

Phenom
Phenom

Going back to the car assembly example, let's say you select a face on the right front wheel; you have selected an instance of the original wheel face. You can use faceRef.Prototype to get access to the face defined in the wheel part (the parent face of the instances). You can use the .IsOccurrence property to determine if you have a reference to an instance (occurrence) or not.

Re: Difference between Part, BasePart and Component

Builder
Builder
Okay thank you. That helps me a lot.
CONFIDENTIALITY WARNING: This email communication and any attachments contain privileged and confidential information intended only for the use of the intended recipient. If the reader of this communication is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution, use or reproduction of this communication or its attached contents is prohibited. If you have received this communication in error, please notify us immediately by return email and delete this message and any attachment from your system.

Re: Difference between Part, BasePart and Component

Esteemed Contributor
Esteemed Contributor

The SNAP getting started guide has the latest graphical representation and explanation for assembly relations.

 

SNAP is an extension to NXOpen .NET, so many explanations are useful for regular NXOpen programming too.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Difference between Part, BasePart and Component

Siemens Phenom Siemens Phenom
Siemens Phenom

And, if you're new to NX programming, it might be useful to browse through the rest of the "Getting Started with SNAP" guide, too, in addition to reading the Assemblies chapter.

山田
yamada