【NX二次开发】 删除面操作
阅读原文时间:2023年07月09日阅读:3

录制修改封装删除面 DeleteFaces

1 #include
2 #include
3 #include
4 #include
5 #include
6 #include
7 #include
8 #include
9 #include
10 #include
11 #include
12 #include
13 #include
14 #include
15 #include
16 #include
17 #include
18 #include
19 #include
20 #include
21 #include
22 #include
23 #include
24 #include
25 #include
26 #include
27 #include

1 static void DeleteFaces(vector tagFaces)
2 {
3 if (tagFaces.size() == 0) return;
4 vector deleteface;
5 for (int i = 0; i < tagFaces.size(); i++) 6 { 7 NXOpen::Face *face1(dynamic_cast(NXOpen::NXObjectManager::Get(tagFaces[i])));
8 deleteface.push_back(face1);
9 }
10
11 Session *theSession = Session::GetSession();
12 Part *workPart(theSession->Parts()->Work());
13 Features::Feature *nullFeatures_Feature(NULL);
14 Features::DeleteFaceBuilder *deleteFaceB;
15 deleteFaceB = workPart->Features()->CreateDeleteFaceBuilder(nullFeatures_Feature);
16 FaceDumbRule *faceDumbRule1;
17 faceDumbRule1 = workPart->ScRuleFactory()->CreateRuleFaceDumb(deleteface);
18 std::vector rules1(1);
19 rules1[0] = faceDumbRule1;
20 deleteFaceB->FaceCollector()->ReplaceRules(rules1, false);
21 NXObject *nXObject1;
22 nXObject1 = deleteFaceB->Commit();
23 deleteFaceB->Destroy();
24 }

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章