NX二次开发-NXOPEN获取所有工程图和所有视图DrawingSheet,DrawingSheetCollection,DraftingView
标签:遍历 i++ text aes ++ open ring tor ESS
1 NX11+VS2013
2
3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14
15
16 Session *theSession = NXOpen::Session::GetSession();
17 Part *workPart(theSession->Parts()->Work());
18
19 //迭代器遍历所有图纸页
20 vector<:drawings::drawingsheet> AllSheet;
21 NXOpen::Drawings::DrawingSheet* MySheet;
22 NXOpen::Drawings::DrawingSheetCollection::iterator Ite;//定义迭代器
23 for (Ite = workPart->DrawingSheets()->begin(); Ite != workPart->DrawingSheets()->end(); ++Ite)
24 {
25 MySheet = (*Ite);//赋值
26 AllSheet.push_back(MySheet);
27 }
28
29 //获得图纸页里的所有视图
30 vector<:drawings::draftingview> AllSheetView;
31 for (int i = 0; i )
32 {
33 vector<:drawings::draftingview> MySheetView = AllSheet[i]->GetDraftingViews();
34
35 for (int j = 0; j )
36 {
37 //获取视图名字
38 NXString ViewName = MySheetView[j]->Name();
39 AllSheetView.push_back(MySheetView[j]);
40
41 //打印
42 theSession->ListingWindow()->Open();
43 theSession->ListingWindow()->WriteLine(ViewName.GetLocaleText());
44 }
45 }
46
47 Caesar卢尚宇
48 2019年11月17日
NX二次开发-NXOPEN获取所有工程图和所有视图DrawingSheet,DrawingSheetCollection,DraftingView
标签:遍历 i++ text aes ++ open ring tor ESS
原文地址:https://www.cnblogs.com/nxopen2018/p/11876232.html
评论