|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
! d8 @9 t0 [. Z- E1 g! |- void skeTChTest::extrude(Sketch *sketch)6 x9 t! ]. \4 k6 Y0 n3 z, ^
- {
) n6 | E ~7 W) F# x - Features::Feature *null_feature(NULL);
% |6 h4 ]) y! i: v' a2 W - Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);
( d7 ^& q7 x2 a. H. \ - NXOpen::Section *section = workPart->Sections()->CreateSection();) ^. B6 J0 \& l" G7 R" L
- extrudeBuilder->SetSection(section);7 G* @" v7 `0 n. m
-
2 v \; v, o5 c% X - vector<Features::Feature * > featureRule(1);
& P( c. c4 U* ^! `: G- m - featureRule[0] = sketch->Feature();
$ p G( D. K+ K2 ]/ r3 V - CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);& S: `0 D8 |. u+ f1 p
- std::vector <SelectionIntentRule *> rule(1);
4 g/ _5 q- A: r/ X3 b3 [: f% q# [, a - rule[0] = curveFeatureRule;
6 t. o+ z% s: o% B* a# h - NXOpen::NXObject *nullObject(NULL);
6 `# e1 K. f9 N, B. h2 K - section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);6 I* H( q% [4 @4 k
- * V k! v/ r) I
- extrudeBuilder->Limits()->StartExtend()->SetValue("0");) Q% z, c9 o- V- J
- extrudeBuilder->Limits()->EndExtend()->SetValue("100");1 l5 M$ _$ y: ~+ \. @ g: j0 \* z- j
- Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);5 m$ g6 T$ l+ k1 e1 K7 R$ z
- extrudeBuilder->SetDirection(direction);/ d! u5 G0 J3 K; B, `$ E. N
- 9 {9 Q) Z& B/ V6 ?4 F( [$ B
- extrudeBuilder->CommitFeature();
1 U) \3 O$ N! g+ M+ y. e/ e - extrudeBuilder->Destroy();
+ X" s; w6 R' W9 O- A9 P, J - ! E! ~- j; D( U! v4 q- a
- }
复制代码 8 \) z: y% o: m
/ y5 S8 _. d3 r3 [1 Q1 S
这是一个拉伸草图特征的二次开发源码,仅供参考& b. @* X( O3 q% J% Q0 s" w
" ?: w# M* I+ n K. t
) c% d- k9 y# k! J6 r
2 A$ |5 [9 E Y0 h/ U! q }
9 l0 j1 ]2 Q' ]4 V |
|