|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- 0 c2 O. I4 d# Y! E" h. Z
- void skeTChTest::extrude(Sketch *sketch)3 s4 O! H: x2 z9 x
- {
8 l* U" x' a# M - Features::Feature *null_feature(NULL);
+ V( w/ m( D4 k- P - Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);2 q2 b: W) e5 q- `: {3 }0 @2 L# R0 o
- NXOpen::Section *section = workPart->Sections()->CreateSection();
: ^+ t" n p: B9 @4 T h2 y* W7 Q5 M - extrudeBuilder->SetSection(section);; l+ y! o' o% _7 @2 }
- $ N# `, k! ~6 q' v# j1 e
- vector<Features::Feature * > featureRule(1);
. Q D7 Z6 M% y; o! _ - featureRule[0] = sketch->Feature();# @5 }1 d3 d% r% ~8 d
- CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);! r; x6 i! ] @* _; q3 H" V0 ^+ `
- std::vector <SelectionIntentRule *> rule(1);3 F6 t% }: n9 u) \1 x; x6 [9 j
- rule[0] = curveFeatureRule; ^/ z* P7 X0 p. i6 S+ o
- NXOpen::NXObject *nullObject(NULL);
5 s; G0 n, ]1 _" V - section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);
4 Y6 j1 p/ r7 F5 G
5 |1 R% X+ c" y" w$ X2 a- extrudeBuilder->Limits()->StartExtend()->SetValue("0");7 N/ M! E9 A( t! Y9 ]8 L5 i
- extrudeBuilder->Limits()->EndExtend()->SetValue("100");+ t( @/ W' B# R3 n6 w
- Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);4 u" V/ e+ H- ~9 L& i
- extrudeBuilder->SetDirection(direction);
9 `& b3 e* T9 U) u6 \' B; l - 3 A0 l3 [/ p) i5 g
- extrudeBuilder->CommitFeature();
" _7 T) x: O- m - extrudeBuilder->Destroy();1 X3 y6 s6 T5 t/ |8 C; a4 B' E
- % H5 ^" T+ a% d3 i1 ^" X; v
- }
复制代码
5 _+ q( s! l0 C5 F; h- N% E# v) T6 r }5 G
这是一个拉伸草图特征的二次开发源码,仅供参考
8 d1 p9 R( M1 H; J! E' ~" e
, f$ |1 J4 r, z3 g' H8 d4 C5 t+ q3 O4 o+ o. p) E" O7 ?
7 J/ z* e/ a0 o5 ~" F2 i5 s! q, {
$ z0 `5 q5 A$ s% N/ S, M |
|