批处理模式prt转stp,程序报错
想利用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出现报错信息。
报错信息如下:
D:\Siemens\NX 8.5\UGII>EscoUpdate.exe -t 4 -p a
====================================================
Failed to handle error condition correctly - exiting
Unable to update settings table
====================================================
====================
Fatal error detected
==================== 通常情况下,代码还要指定.def文件。
页:
[1]