Showing results for 
Search instead for 
Did you mean: 

NX Open API: UFSession.Part.CloseAll throws exception


I am using NX Open API to read information from NX files.


Following are steps of my code -

1. In load options, set load options as below-

    LoadOptions.UsePartialLoading = true;

    LoadOptions.SetInterpartData(false, LoadOptions.Parent.Partial)


2. Use "TheUFsession.Part.Open" API to open the file

3. Extract properties

4. Change load options as below -

    LoadOptions.UsePartialLoading = false;

    LoadOptions.SetInterpartData(true, LoadOptions.Parent.Immediate)

5. Use "TheUFsession.Wave.LoadParents" option to load wave relation data

6. Get Wave relations

7. Use TheUFsession.Part.CloseAll() to close all files


In case of some files, at step 7, an exception is thrown. The exception message is - "Duplicate Section cut found in section-cut list" or "An illegal file was given to the tag system"


Could anyone please guide why this is throwing exception?


Thanks in advance.




Re: NX Open API: UFSession.Part.CloseAll throws exception

Esteemed Contributor
Esteemed Contributor

See if the same error happens if you do the same steps interactively.

We've had issues with assemblies that "close all" would fail.  Only option was to Exit NX.

If it fails interactively, API won't fix that - you need to fix the assembly.


Also - what version of NX?

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled

Re: NX Open API: UFSession.Part.CloseAll throws exception


Sorry,for late reply. The files are opening fine in interactive way. I am using NX


The same file does not give any error if I use UFSession.Part.Close and then use UFSession.Part.Open to open the file.


I am trying with NXOpen.Part.ComponentAssembly.OpenComponents API now. Will update here later.