其他分享
首页 > 其他分享> > NX二次开发-NXOPEN工程图导出CAD图纸DxfdwgCreator *dxfdwgCreator1;

NX二次开发-NXOPEN工程图导出CAD图纸DxfdwgCreator *dxfdwgCreator1;

作者:互联网

没有什么可以看的,NXOPEN直接录制一下导出CAD就可以了。
录制出来自己挑需要的代码拿过来改一下。

 1 NX9+VS2012
 2 
 3 
 4 #include <NXOpen/Part.hxx>
 5 #include <NXOpen/PartCollection.hxx>
 6 #include <NXOpen/Session.hxx>
 7 #include <NXOpen/DxfdwgCreator.hxx>
 8 #include <NXOpen/DexManager.hxx>
 9 
10 
11 
12 DxfdwgCreator *dxfdwgCreator1;
13 dxfdwgCreator1 = theSession->DexManager()->CreateDxfdwgCreator();
14 
15 dxfdwgCreator1->SetExportData(DxfdwgCreator::ExportDataOptionDrawing);
16 
17 dxfdwgCreator1->SetAutoCADRevision(DxfdwgCreator::AutoCADRevisionOptionsR2004);
18 
19 dxfdwgCreator1->SetViewEditMode(true);
20 
21 dxfdwgCreator1->SetFlattenAssembly(true);
22 
23 dxfdwgCreator1->SetExportScaleValue("1:1");
24 
25 //dxfdwgCreator1->SetOutputFileType(DxfdwgCreator::OutputFileTypeOptionDxf);//导出DXF
26 dxfdwgCreator1->SetOutputFileType(DxfdwgCreator::OutputFileTypeOptionDwg);//导出DWG
27 
28 dxfdwgCreator1->SetOutputFile("D:\\test5.dwg");
29 
30 dxfdwgCreator1->ObjectTypes()->SetCurves(true);
31 
32 dxfdwgCreator1->ObjectTypes()->SetAnnotations(true);
33 
34 dxfdwgCreator1->ObjectTypes()->SetStructures(true);
35 
36 dxfdwgCreator1->SetInputFile("D:\\test5.prt");
37 
38 NXObject *nXObject1;
39 nXObject1 = dxfdwgCreator1->Commit();
40 
41 dxfdwgCreator1->Destroy();

标签:DxfdwgCreator,include,ObjectTypes,导出,工程图,二次开发,dxfdwgCreator1,true
来源: https://www.cnblogs.com/nxopen2018/p/10957503.html