|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
7 r3 K0 z# |/ u; T- void skeTChTest::extrude(Sketch *sketch)
, Q" Y9 \% B3 j! V8 ^! ^ - { Z T5 p. t7 Z) ?1 q9 o
- Features::Feature *null_feature(NULL);* {3 D, Y9 y( ]: S% n
- Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);
* g4 M% a0 A' S - NXOpen::Section *section = workPart->Sections()->CreateSection();
) }! m& G% S! ]1 \ - extrudeBuilder->SetSection(section);3 D+ I$ m- I' b( ?. R- X' z
- 3 W @& R$ F% k; K
- vector<Features::Feature * > featureRule(1);* z& x9 p5 z0 i+ a- a
- featureRule[0] = sketch->Feature();
+ Q* q2 l5 `. K9 ` - CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);" ^5 j3 a3 |* \/ i, ?# g
- std::vector <SelectionIntentRule *> rule(1);
9 i8 X% K& j- X- ] - rule[0] = curveFeatureRule;0 x: Q6 q" q1 z' Z! u* D
- NXOpen::NXObject *nullObject(NULL);4 t, `( ?( q6 W# D* X
- section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);
F2 Y5 p0 Q4 L b i1 |
! V% ?* c3 Y9 X& L: Z- extrudeBuilder->Limits()->StartExtend()->SetValue("0");; M L0 w2 b2 `; a! V: L# X) ^
- extrudeBuilder->Limits()->EndExtend()->SetValue("100");+ V. M- x! H: _6 @4 f" e0 }
- Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);0 H$ w1 j4 [: L
- extrudeBuilder->SetDirection(direction);1 G0 x0 Z( B. U6 r9 w0 s
- 5 Y& j+ N/ \6 j4 Y
- extrudeBuilder->CommitFeature();
5 y: }( j) N( I# d - extrudeBuilder->Destroy();8 j5 Q0 V7 f Y2 \# { C& G
$ ]5 j* |3 J! u- }
复制代码 ! J) P1 G. P7 a
) \, ` ^2 l% K
这是一个拉伸草图特征的二次开发源码,仅供参考4 ?8 X1 r a& ^3 @4 \: }5 H
& K4 ]. M- n. W% |, P# X% ]* n1 i$ S8 ~7 V9 P
; g0 K4 @. Z, C9 e7 Z. f
( ?' J: ~5 \" a% Q6 ^
|
|