|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- @ v8 B8 T. Q3 z3 u5 W9 [- void skeTChTest::extrude(Sketch *sketch)
! I( I; I" r8 ]( I( ^, ` - {- B# t9 W6 x' |. `) o
- Features::Feature *null_feature(NULL);# a5 G( u% I# e( d1 X) j: y: Q+ C( A: d
- Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);
6 l9 [2 v9 G' ?4 B2 R - NXOpen::Section *section = workPart->Sections()->CreateSection();$ i) L8 Y, t' V0 x3 w
- extrudeBuilder->SetSection(section);6 m7 }, i2 J7 m& L' G+ a- X
- 2 u: |8 I% `3 ^8 C8 ?" m
- vector<Features::Feature * > featureRule(1);( [+ m# G6 G2 c' A0 ]$ r
- featureRule[0] = sketch->Feature();
" q1 \, a% Y2 e2 P/ |: M' C - CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);, A3 }' ?4 S' b/ o) @( j0 Z1 i
- std::vector <SelectionIntentRule *> rule(1);
! O1 W. T. N# A5 c+ ?9 Y- S - rule[0] = curveFeatureRule;, [" o' u# o" h3 c. s, R0 @3 ^# e. z
- NXOpen::NXObject *nullObject(NULL);/ `! w1 E2 t; q @: x8 H
- section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);
& h+ O- w2 s4 M% D' R+ ?2 b
1 |0 \6 I+ s, V8 h6 U# ~- extrudeBuilder->Limits()->StartExtend()->SetValue("0");
P" M3 i$ {3 g1 j f- ]! ^9 `* [! @1 { - extrudeBuilder->Limits()->EndExtend()->SetValue("100");
8 R8 u# S( g4 I+ Z# } - Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);
; l8 M: E& x. S- ^: P w& Y - extrudeBuilder->SetDirection(direction);
" V4 u5 _& c- [( p3 ~5 k+ ]
) a R, h" ]; p2 j- extrudeBuilder->CommitFeature();
# c: g1 c# }% K% [( d# O9 O5 G - extrudeBuilder->Destroy();; Z( _- M" i: _
# X, V3 J+ s9 d+ _* Z. w- }
复制代码
9 x9 e$ E" s( v T5 t+ y8 c3 w: z1 P. J- j; q3 ?6 G
这是一个拉伸草图特征的二次开发源码,仅供参考- ]( ~- e1 k2 ] t
2 }. @4 K' D( }" {7 ~( K+ u6 \; w3 j8 Y$ j
+ |2 S# H. B) f3 N; }2 r$ Y: d$ C+ S# t; I: k& U z+ s
|
|