|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
$ P! z( R- B; q& O S" _: c9 X- void skeTChTest::extrude(Sketch *sketch)0 ^. k* d& Y S; w! J* X6 E
- {/ N( w0 u/ F+ L4 T2 N9 p( W
- Features::Feature *null_feature(NULL);
1 o6 x8 {8 E2 z' Y1 S- N. Y$ y - Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);
" K0 c3 H0 }9 L9 d' l! v - NXOpen::Section *section = workPart->Sections()->CreateSection();
( z% K0 }7 O; V5 s% P - extrudeBuilder->SetSection(section);
X$ G% |, c1 X% s- f6 ? - % y' X/ ~" K2 [3 }3 j
- vector<Features::Feature * > featureRule(1);( G8 T2 a7 V: R [+ @/ S
- featureRule[0] = sketch->Feature();3 _1 u. B- W; y7 C
- CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);8 d# T2 }& C5 }, b
- std::vector <SelectionIntentRule *> rule(1);
3 d6 B; Z8 b, V, D! p* _# n" v - rule[0] = curveFeatureRule;
- u+ a9 V5 E/ y$ U - NXOpen::NXObject *nullObject(NULL);( w( S, d' \2 ?! H; `7 @
- section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);9 w) m+ [# B+ O: A
- ' J- ~8 N [4 [$ \" j k7 [
- extrudeBuilder->Limits()->StartExtend()->SetValue("0");1 `! l0 c4 O: {9 \$ E! y* Z
- extrudeBuilder->Limits()->EndExtend()->SetValue("100");
3 ?9 f3 F: g. V! ^4 W: S - Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);
3 S, ~* W3 }) ?3 p2 d' M( ^$ V - extrudeBuilder->SetDirection(direction);
9 n/ Y2 f F; x& I6 j; } - # B5 I, R3 R: _3 L! U5 ]% p& |
- extrudeBuilder->CommitFeature();
" o9 S4 c% \: _ - extrudeBuilder->Destroy();
: y, ~- D2 O! e6 V1 V
% Y9 s1 H* o4 n+ V- }
复制代码
. F3 H! r# s- ^: ]( X4 q
1 Y# y- e. ^0 n: r. J! O: _% y这是一个拉伸草图特征的二次开发源码,仅供参考
/ b) W/ r, w9 W3 \# B* n% l+ c1 a% w* i' g7 j
6 g7 L4 B7 s" ]* X8 C( t
2 w- B8 H* I4 M' x7 R
2 x+ q: }3 K. T# u( D( J# j4 \ |
|