// Created by: Jet_jiang // Language: C++ // Version: NX 10 // Date: 12-26-2019 // Time: 22:00 //头文件 #include <NXOpen/DexBuilder.hxx> #include <NXOpen/DexManager.hxx> #include <NXOpen/NXObject.hxx> #include <NXOpen/ObjectTypeSelector.hxx> #include <NXOpen/Part.hxx> #include <NXOpen/PartCollection.hxx> #include <NXOpen/ImportManager.hxx> #include <NXOpen/Importer.hxx> void PrtImportX_t(NXString AllPath) { NXOpen::Session *theSession = NXOpen::Session::GetSession(); NXOpen::Part *workPart(theSession->Parts()->Work()); NXOpen::Part *displayPart(theSession->Parts()->Display()); // ---------------------------------------------- // Menu: 文件(F)->导入(M)->Parasolid... // ---------------------------------------------- NXOpen::Importer *importer1; importer1 = workPart->ImportManager()->CreateParasolidImporter(); importer1->SetFileName(AllPath);//路径 NXOpen::NXObject *nXObject1; nXObject1 = importer1->Commit(); importer1->Destroy(); }
原文:https://www.cnblogs.com/NXString/p/12104522.html