×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

save data into iges

save data into iges

save data into iges

(OP)
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

RE: save data into iges

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.

RE: save data into iges

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.

RE: save data into iges

If you want to create a journal, you could record one while using File/Export/IGES. This would give you a starting point.

Mike Hyde
www.astonmartin.com
NX8.5 with TC9.1

RE: save data into iges

(OP)
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

RE: save data into iges

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

RE: save data into iges

(OP)
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.

RE: save data into iges

Have you successfully called other NX functions from your program(s)?

www.nxjournaling.com

RE: save data into iges

(OP)
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:
*DexManager1= NXOpen::DexManager(theSession);
NXOpen::IgesCreator *igesCreator1=DexManager1->CreateIgesCreator();

so i think the way I instantiate the DexManger and IgesCreator objects are wrong?

RE: save data into iges

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

RE: save data into iges

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources