|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- 6 C" Z1 {; X* C% t
- void skeTChTest::extrude(Sketch *sketch)6 E/ r: d# c5 T8 S3 g: m
- {4 p1 Q' X. C( ~1 V& k' i- s- c
- Features::Feature *null_feature(NULL);
n4 U" E- I g. E5 l - Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);: ?4 o7 Q+ h3 l
- NXOpen::Section *section = workPart->Sections()->CreateSection();. P" l5 D f8 M7 h! B
- extrudeBuilder->SetSection(section);
6 m- F" x: |8 x$ [* u! l+ c7 t w% U - ( _+ }/ S% }4 W* Q) t5 D7 U. [
- vector<Features::Feature * > featureRule(1);
" G3 E) U* E+ r, z1 n - featureRule[0] = sketch->Feature();
- g3 \& C8 X6 D4 Q" y0 @ - CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);0 V9 ~7 V: M3 x3 X/ h% \
- std::vector <SelectionIntentRule *> rule(1);
0 G8 e5 k' I- A: V/ b - rule[0] = curveFeatureRule;
6 U7 L' a1 ^$ E# D8 ^& t. w, h - NXOpen::NXObject *nullObject(NULL);7 m0 x3 G! [$ N1 ]
- section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);8 k) a: c' L% N
6 l. e. [5 E4 w3 T7 d- extrudeBuilder->Limits()->StartExtend()->SetValue("0");
' G( c* l3 O+ n# [* J - extrudeBuilder->Limits()->EndExtend()->SetValue("100");2 q H4 b+ ]5 m* _# x
- Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);1 Y$ S, O1 |2 x1 ^) a
- extrudeBuilder->SetDirection(direction);
7 o6 p# N9 y2 m9 Z$ v6 Z, q/ p - ; V w7 B( B% K" R6 G3 ]
- extrudeBuilder->CommitFeature();
5 M" ~9 v9 R# s% g; c5 Z4 u - extrudeBuilder->Destroy();
" _$ C8 x5 |& R( I - : J7 n2 A( c1 M
- }
复制代码
5 V) d5 N& K3 ?$ Y3 N; I
, {" w( P) n6 h: s, k% B这是一个拉伸草图特征的二次开发源码,仅供参考, ]4 i+ W8 D! L) O! v" b5 A6 T
" Z+ J. K+ x) g0 }; G
) ^9 i$ u0 ], X1 q$ I2 p3 E
4 r ~6 R7 \% W0 @4 _: {% Z; y7 h: Y3 i' ]
|
|