|
想利用NX二次开发批处理模式,生成exe,完成prt文件转换成stp文件。NX版本为8.5 32位,操作系统为win7。
代码如下:
- #include <NXOpen/Part.hxx>
- #include <NXOpen/PartCollection.hxx>
- #include <NXOpen/Session.hxx>
- #include <NXOpen/Step214Creator.hxx>
- #include <NXOpen/DexManager.hxx>
- using namespace NXOpen;
- void EscoNXServices::export214Stp()
- {
- NXOpen::Session *theSession = NXOpen::Session::GetSession();
- Step214Creator *step214Creator1;
- step214Creator1 = theSession->DexManager()->CreateStep214Creator();
- step214Creator1->ObjectTypes()->SetSolids(true);
- step214Creator1->SetInputFile("D:\\Block.prt");
- step214Creator1->SetOutputFile("D:\\Block.stp");
- step214Creator1->SetFileSaveFlag(false);
- step214Creator1->SetLayerMask("1-256");
- NXObject *nXObject1;
- nXObject1 = step214Creator1->Commit();
- step214Creator1->Destroy();
- }
复制代码 运行生成的exe出现报错信息。
|
|