|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- 0 X& j/ t' s& k5 N3 h. k0 L6 ], c* a
- void skeTChTest::extrude(Sketch *sketch), F5 r! B5 D6 B# Y6 M3 A0 {' @
- {& B0 i7 q9 z9 a2 g* w9 E
- Features::Feature *null_feature(NULL);
( O2 c8 K4 M8 C# H& g# c - Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);& N' } I/ S4 H9 ^. J/ a
- NXOpen::Section *section = workPart->Sections()->CreateSection();
6 n- S+ |! `; x$ W) ~/ G: P# H - extrudeBuilder->SetSection(section);
* C/ I/ g2 i& D$ S6 e - 6 {' l1 k1 h* q- F1 x
- vector<Features::Feature * > featureRule(1);
: j& }7 S: ] v% l/ Z - featureRule[0] = sketch->Feature();& k& B6 O0 L. n" A& f# \0 k- A
- CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);$ H; H r2 z7 O- G
- std::vector <SelectionIntentRule *> rule(1);4 N$ i0 O: \( A, B7 A
- rule[0] = curveFeatureRule;. {8 w+ S+ b% K1 v
- NXOpen::NXObject *nullObject(NULL);
* ~: {3 N. p. u* ^ - section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);
9 Y1 o5 l- T' [ y% j8 W& {& K - 0 X$ Q3 V9 N$ m$ F" h& Z, M1 k
- extrudeBuilder->Limits()->StartExtend()->SetValue("0");5 n/ r$ e3 d y# k0 E& l
- extrudeBuilder->Limits()->EndExtend()->SetValue("100");
# `& J( {6 L- J2 }& X# T0 N0 P1 p S - Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);9 `: Z, Q! L% Q+ t7 ]# i
- extrudeBuilder->SetDirection(direction);: k$ u) @3 X- _5 S4 |
# b. j6 ]- r& f1 R; z* G( k- extrudeBuilder->CommitFeature();, \; H' L: a- _! c- R v; }) i! f
- extrudeBuilder->Destroy();1 V: Q* g4 u! O1 \4 F Z
- 2 {: T @2 y# R/ t
- }
复制代码 ! P, |5 X6 p$ T5 b
8 m0 \4 c" ?" H
这是一个拉伸草图特征的二次开发源码,仅供参考- w4 p$ w: B- y9 w. n
- b1 S, D. K% v/ V* Q: ~. g6 a2 E: y$ Z# ^. e% l$ o# [
+ r5 Q6 G7 y" G* L
8 e1 [9 w9 R* |# V% \& }. w. W
|
|