|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
3 k$ w" z! F6 Q) h! j. l: q- void skeTChTest::extrude(Sketch *sketch)
% V2 J' ~$ g. i' h( J - {
4 f' O, |& m+ I( g - Features::Feature *null_feature(NULL);5 A$ P6 l# x `+ a. M& `
- Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);
1 t: {7 X: t# J( a - NXOpen::Section *section = workPart->Sections()->CreateSection();, H; B8 Q- r1 T) m! Y5 z p: |
- extrudeBuilder->SetSection(section);
$ |: G+ B% L9 |) l; n+ I; E2 m - 4 T3 P( S0 i- K6 K/ G4 t+ H. u
- vector<Features::Feature * > featureRule(1);! j; H' e( n/ i( d
- featureRule[0] = sketch->Feature();
) j$ d* w! [0 D8 Y3 ` - CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);
3 y# x# R& }# t3 K9 C - std::vector <SelectionIntentRule *> rule(1);5 e, K. x7 M4 y, p6 e& _
- rule[0] = curveFeatureRule;
: K" G# C( p' h7 j7 M4 I - NXOpen::NXObject *nullObject(NULL);, q* y4 d2 z7 Y' k8 M
- section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);
8 ^/ u/ l! n# G3 r! P0 D
2 y) o8 F: A- M p: Q- `- extrudeBuilder->Limits()->StartExtend()->SetValue("0");" X% y% T: M1 P5 b
- extrudeBuilder->Limits()->EndExtend()->SetValue("100");, b( P* n1 z( J
- Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);
3 f" ~8 n W0 ]% i. t - extrudeBuilder->SetDirection(direction);" }1 K/ {1 e: Q8 a
) u" i4 c" |' x$ V6 x2 A/ s/ O, X- extrudeBuilder->CommitFeature();
, b! v' f& v2 H0 r - extrudeBuilder->Destroy();' U: @" {) H$ p/ }* Z0 X b% ]9 L
- 7 _$ W1 U+ g5 E: \6 t/ x0 W2 }6 k
- }
复制代码
. |- _) N; ^" V, D3 b# P
: n9 } h" O* }; V* S; ]这是一个拉伸草图特征的二次开发源码,仅供参考9 P. w6 T. U% q( ]8 N
# z+ ?' M- C& ], L% N
; d2 u; F7 H* J" A% @4 w& K7 E: i6 V# H5 A/ O6 h- F
0 X R, d9 U# g, }5 u |
|