首页 UG二次开发NXOpen c++导出STP程序代码

UG二次开发NXOpen c++导出STP程序代码

小白鼠 2019-03-29 12:42:37 0 4041
//UG二次开发NXOpen导出STP程序代码
//需要的头文件
#include <uf_defs.h>
#include <NXOpen/NXException.hxx>
#include <NXOpen/Session.hxx>
#include <NXOpen/Builder.hxx>
#include <NXOpen/DexManager.hxx>
#include <NXOpen/NXObject.hxx>
#include <NXOpen/ObjectSelector.hxx>
#include <NXOpen/ObjectTypeSelector.hxx>
#include <NXOpen/Part.hxx>
#include <NXOpen/PartCollection.hxx>
#include <NXOpen/SelectNXObjectList.hxx>
#include <NXOpen/Session.hxx>
#include <NXOpen/Step214Creator.hxx>

//C++程序代码
Step214Creator *step214Creator1;
step214Creator1 = theSession->DexManager()->CreateStep214Creator();

//设置要被导出的PRT
step214Creator1->SetInputFile("E:\\NXdata\\UGpart\\NX7.5\\constrainTemp3\\assmRoot.prt");

//设置导出的位置和文件名
step214Creator1->SetOutputFile("E:\\test\\4\\assmRoot.stp");

step214Creator1->ObjectTypes()->SetCurves(true);
step214Creator1->ObjectTypes()->SetSurfaces(true);
step214Creator1->ObjectTypes()->SetSolids(true);
step214Creator1->ObjectTypes()->SetCsys(true);
step214Creator1->ObjectTypes()->SetProductData(true);
step214Creator1->SetValidationProperties(true);


step214Creator1->SetExportExtRef(true);
step214Creator1->SetSettingsFile("E:\\NXdata\\Siemens\\NX7.5\\step214ug\\ugstep214.def");
step214Creator1->ObjectTypes()->SetProductData(false);
step214Creator1->SetExportExtRef(false);

step214Creator1->SetValidationProperties(false);
step214Creator1->SetFileSaveFlag(false);
step214Creator1->SetLayerMask("1-256");
NXObject *nXObject1;
nXObject1 = step214Creator1->Commit();
step214Creator1->Destroy();
导出 · STP ·

发表评论