Showing results for 
Search instead for 
Do you mean 
Reply

Create Part file in NX 8.5 with parts in background

[ Edited ]

Hello all,

 

I am creating a part file using NXOpen c++. I am not able to create if any existing part file is opened. If I close all parts from NX, then im able to create part file. Here is my code 

 


NXOpen:: Part *part1;
NXOpen:: Session *thesesion = NXOpen:: Session:: GetSession();
NXOpen:: NXString partName = strCurrentDir + "\\x-files\\x-"+ cPartFileSubstr +"lisg.prt";
part1 = thesesion->Parts()->NewDisplay(partName, NXOpen:: Part:: UnitsInches);

......

.

.

.

.

.

.

NXOpen:: PartSaveStatus *partSaveStatus;
part1->Save(NXOpen:: Part:: SaveComponentsTrue,NXOpen:: Part:: CloseAfterSaveTrue);

 

 

I should be able to do with parts opened in backgrownd. Can anyone help me how to do it

 

 

 

 

 

 

Thanks in advance

2 REPLIES

Re: Create Part file in NX 8.5 with parts in background

I think you should be using NewBaseDisplay instead of NewDsiplay.

Re: Create Part file in NX 8.5 with parts in background

[ Edited ]

You also can close all parts first:
theSession->Parts->CloseAll(BasePart::CloseModified::CloseModified, NULL);