|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- 5 \) Y$ p0 H1 D
- void skeTChTest::extrude(Sketch *sketch)2 t: j4 I7 S. F& k( N
- {9 G( }3 g+ c: m. \# b) O6 ?8 \
- Features::Feature *null_feature(NULL);
, G& `) x" D# I) q0 Y7 p* l - Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);
/ G7 r# s" d1 k; p* v' G; f - NXOpen::Section *section = workPart->Sections()->CreateSection();. J5 R7 M6 a# y" m, v, |, \3 s) o
- extrudeBuilder->SetSection(section);
/ w1 y& x/ }: V& p5 d" e7 _# j - 5 `, l& `7 t4 P2 N2 b+ c( Z$ I
- vector<Features::Feature * > featureRule(1);8 s d2 D* N! [6 }1 P' o) g' x: g
- featureRule[0] = sketch->Feature();& E3 M+ Q; v4 G) F u8 v6 O& Q+ s; m
- CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);0 D/ n! G0 S3 R9 Z( Q' H8 t; V
- std::vector <SelectionIntentRule *> rule(1);4 g# h8 y, N9 c4 g: O9 b
- rule[0] = curveFeatureRule;
. e3 o, x0 _0 C - NXOpen::NXObject *nullObject(NULL);; s7 s5 D- M0 n: T
- section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);
* W; x& `8 p6 ~3 K! { - * ^* r' H3 z( V. v1 ?9 ]% [, e
- extrudeBuilder->Limits()->StartExtend()->SetValue("0");
3 x- i) z+ j& t1 \$ m' q - extrudeBuilder->Limits()->EndExtend()->SetValue("100");- r, V6 Q g$ F1 C
- Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);* r$ M; `( A- V0 ]! W
- extrudeBuilder->SetDirection(direction);
- @( K6 }% R5 L7 ?9 T - 7 v0 z8 W5 G1 Z
- extrudeBuilder->CommitFeature();: P$ e% ^1 T- k, T+ ]1 B
- extrudeBuilder->Destroy();8 S1 X7 z- B8 C6 I' \" W( M
- 7 C5 s' L) ]+ R( ?
- }
复制代码 ( ~% z; V9 ?' ~8 U
! m. j0 }1 P: l& G
这是一个拉伸草图特征的二次开发源码,仅供参考
, z( w w8 b% Y5 Q5 C: `, j8 q9 u1 z7 O; R6 E+ i
3 _7 p- e5 q# x/ ~
5 l* Q# ?/ m+ [2 H8 W. Y" k
% I' X/ i/ v# ?) P1 U/ d |
|