|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- / l s7 J; m# M4 T
- void skeTChTest::extrude(Sketch *sketch)
; _" \9 z* h6 B2 G- v5 \ - {6 \8 T& K+ @. p
- Features::Feature *null_feature(NULL);* r0 k) f- E" |6 D2 C8 g0 ]
- Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);
' b4 z$ @- ^8 c7 j% n J - NXOpen::Section *section = workPart->Sections()->CreateSection();; q$ t3 F6 e7 K+ J* b& s1 f) N/ r
- extrudeBuilder->SetSection(section);" Q& S8 u+ Q9 P* x2 o) m
-
( \) R/ ^4 E6 U1 q1 u& i9 C - vector<Features::Feature * > featureRule(1);
! c3 ?) d- H. i( l) _4 e - featureRule[0] = sketch->Feature();/ L! v+ |- Y+ p f
- CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);
3 y4 T' {0 m% U9 I, @8 S, c - std::vector <SelectionIntentRule *> rule(1);0 O9 X) i0 o' ^ } d1 J
- rule[0] = curveFeatureRule;
' p. a7 k( t9 z - NXOpen::NXObject *nullObject(NULL);
" i8 r! n2 N1 ~0 {- x - section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);
- U" R# f2 B+ D$ L q - ) r/ q. z+ G0 D; u3 K
- extrudeBuilder->Limits()->StartExtend()->SetValue("0");9 |( y) Z' O( z& ~- Y
- extrudeBuilder->Limits()->EndExtend()->SetValue("100");+ ]4 J h9 e& \) i$ `. ?0 x
- Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);+ d- x6 R4 ?+ r- j$ O
- extrudeBuilder->SetDirection(direction);
" X/ M* l0 w2 t& }2 f8 I1 i - % l( ], x! M9 E5 l+ m3 D
- extrudeBuilder->CommitFeature();8 p$ {/ L8 f( q+ J. r* q
- extrudeBuilder->Destroy();$ {2 w% `2 q, ^% l% [% f8 Y5 l
- 0 h& [& Q. O: r0 |6 z& U Q
- }
复制代码 ) @6 N' ^& n) b2 E" C& m0 m
4 ~+ s! P6 \) K3 ?4 J$ b
这是一个拉伸草图特征的二次开发源码,仅供参考
6 {5 P' X! ]3 U! E/ e7 V3 D" g2 A) h7 c4 E" E4 h- s" j" t% P3 X
8 a$ M- Q0 f7 V! H1 E" g- m+ j$ R9 `/ W8 i5 J* u; C8 t. Q
5 o1 m7 u$ D: t8 O
|
|