Cancel
Showing results for 
Search instead for 
Did you mean: 

Assembly file vs part file

What is the basic difference in Assembly file and part file.

How to identify assemblyfile using nxopen through programming?

8 REPLIES

Re: Assembly file vs part file

Esteemed Contributor
Esteemed Contributor

Assembly file contains components, piece part file not.

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: NX12.0

How to Get the Most from Your Signature in the Community

Re: Assembly file vs part file

Honored Contributor
Honored Contributor

As @Stefan_Pendl says, if the part has one or more components - then it is an assembly; no components - it is a piece part. One way to check this with the NXOpen API is with the .RootComponent property; if it is a null reference, there are no components (the part is a piece part). If the .RootComponent property returns a component reference, the part file is an assembly. So, if you have a variable that references a part named somePart, the following code would work (VB syntax shown, other languages would be similar):

 

If isNothing(somePart.ComponentAssembly.RootComponent) then
    'this is a piece part
else
    'this is an assembly
end if

 

Edit (additional info): Note that there are some external utilities that will report the components referenced by a particular file (ugpc.exe and ug_edit_part_names.exe). These could be used to determine if a part is an assembly or not without opening the part in NX.

Also note that there is an option called "enforce piece part" that can be enabled for a part file. If this option is set, NX will not allow you to add components to the file.

Re: Assembly file vs part file

Thanks for your quick reply.

Now I would like to convert this assembly file into displayed part.

is it possible to make displayed part?

I have recorded a Journal as follows

NXOpen.Part part1 = (NXOpen.Part)theSession.Parts.FindObject("#1B CROSSMEMBER_07640415_PIA;0,02.01.00 Frame-02.01.01 Frame Assembly12898");
NXOpen.PartLoadStatus partLoadStatus1;
NXOpen.PartCollection.SdpsStatus status1;
status1 = theSession.Parts.SetDisplay(part1, false, true, out partLoadStatus1);

 

But I coulden't found name #1B CROSSMEMBER_07640415_PIA;0,02.01.00 Frame-02.01.01 Frame Assembly12898.

How to get displayed part?

Once again thanks for your reply.

 

 

Re: Assembly file vs part file

Esteemed Contributor
Esteemed Contributor

There should be two variables defined in the journal:

  1. workPart
    • theSession.Parts.Work
  2. displayPart
    • theSession.Parts.Display

Use those to get the respective part instead of the journals FindObject construct.

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: NX12.0

How to Get the Most from Your Signature in the Community

Re: Assembly file vs part file

Honored Contributor
Honored Contributor

Does your code already have a reference to the part that you want to make the display part? If so, use it in the .SetDisplay method.

 

If you do not have a reference to the desired part, you will need to add some logic to your code to find the desired part. Do you know the name of the part? Do you have a reference to an object contained in the part (such as a solid body)? Do you want the end user to enter a name or select an object? Once you know the workflow, you can add the appropriate code.

Re: Assembly file vs part file

Thanks for your reply.

How to convert all component into displayed part at time?

 

Re: Assembly file vs part file

Honored Contributor
Honored Contributor

This link has some code that will process the top level parts of an assembly, setting each as the displayed part in turn.

 

This could be extended to process all the parts in an assembly using similar logic as shown in the article at the top of the same page. In short, once you have a reference to a component, you can get a reference to the defining part file (the component's .Prototype), and then pass in the part reference to the .SetDisplay method.

Re: Assembly file vs part file

Esteemed Contributor
Esteemed Contributor

The is only one active displayed part in NX, you cannot have multiple displayed parts at a time.

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: NX12.0

How to Get the Most from Your Signature in the Community