Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

save data into iges

Status
Not open for further replies.

lugan2

Mechanical
Apr 10, 2013
42
hello all

Is there a NXOPen/UF function allows me to save the geometry into igs file format, rather than a part file (using UF_PART)save() fnction)?

many thanks
Gan
 
Replies continue below

Recommended for you

If my understanding of your question is correct, the go to: FILE, SAVE AS. Then at the bottom of the box in the SAVE AS TYPE, select IGS. Make sure to select your directory.
 
While I don't think NX Open has a specific function for saving a Part file in an iges format, there is the 'iges.bat' file in the \IGES folder that you could call from within an NX Open program and pass it the names of the files that you would want converted to iges. Note that the 'iges.bat' file calls the 'iges.cmd' file which supports several options for defining the output directory as well as to set-up the various translator options. Of course, you could just run IGES from the Windows 'Start' menu.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
Dear all

thanks very much for the reply. I have tried to record a journal file and use that as a reference to write c++ code to covert prt file to igs. Blow is the c++ file I have tried:
//------------------
UF_initialize();
// Initialize the NX Open C++ API environment
NXOpen::Session *theSession = NXOpen::Session::GetSession();
// NXOpen::part *Part1=(NXOpen::part*)NXOpen::NXObjectManager::Get(part_tag);

NXOpen::DexManager *DexManager1=NULL;
*DexManager1= NXOpen::DexManager(theSession);
NXOpen::IgesCreator *igesCreator1=DexManager1->CreateIgesCreator();

igesCreator1->SetExportModelData(true);
igesCreator1->SetExportDrawings(true);
igesCreator1->SetMapTabCylToBSurf(true);
igesCreator1->SetBcurveTol(0.0508);
igesCreator1->SetIdenticalPointResolution(0.001);
igesCreator1->SetMaxThreeDMdlSpace(10000.0);
igesCreator1->SetOutputFile(obj->getname()+".igs");
igesCreator1->SetSettingsFile("/igesexport.def");
igesCreator1->SetMaxLineThickness(2.0);
igesCreator1->SetSysDefmaxThreeDMdlSpace(true);
igesCreator1->SetSysDefidenticalPointResolution(true);
igesCreator1->SetInputFile(obj->getname()+".prt");
igesCreator1->SetFileSaveFlag(true);

NXOpen::NXObject *nxObject1= igesCreator1->Commit();
igesCreator1->Destroy();

UF_terminate();
//----------------------------

but it gives me error at the place of :
*DexManager1= NXOpen::DexManager(theSession);
NXOpen::IgesCreator *igesCreator1=DexManager1->CreateIgesCreator();


could anyone please tell me how to correct it? How can I initialize the CreateIgesCreator() method from a nxsession?

thanks
 
If you play back your recorded journal, does it give the same error?

If not, what are the differences between your code and the recorded journal?

www.nxjournaling.com
 
i read the journal file back to nx and it doesn't allow me to run it. I think it is not a run-able one by missing some definitions such as program execution entrance.
I don't know. I am not familiar with nx/nxopen, but just trying to call some nx functions in my program.
 
hello cowski

yes, I have tried to save my geometry using:
UF_initialisze();
UF_PART_new();
UF_terminate();

and it works fine which can generate the .prt file directly.


For the program above, the compiler gives no complain, the error(segmentation fault) only comes in when it gets to the line:
[highlight #FCE94F]*DexManager1= NXOpen::DexManager(theSession);[/highlight]
NXOpen::IgesCreator *igesCreator1=DexManager1->CreateIgesCreator();

so i think the way I instantiate the DexManger and IgesCreator objects are wrong?
 
Check the variable theSession; if it is a valid, working reference, I'd try:

Code:
NXOpen::IgesCreator *igesCreator1=theSession->DexManager->CreateIgesCreator();

But, then again, my C++ is very rusty, so I make no guarantees...

www.nxjournaling.com
 
the theSession object has valid values, and I tried:
NXOpen::IgesCreator *igesCreator1=theSession->DexManager->CreateIgesCreator();

this was my suspect, but the compiler gives me error message: base operand of '->' is not a pointer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor