|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- ( N- i$ B, J7 f; E" v
- void skeTChTest::extrude(Sketch *sketch)
* |; C! K" s% N( G: l; a/ _8 } - {
. L( j `; i. x& P# {% f - Features::Feature *null_feature(NULL);
5 I, C8 d$ S6 y( `5 E* T% {+ D2 l - Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);
$ Q! R* R$ c1 ?' Y6 Z - NXOpen::Section *section = workPart->Sections()->CreateSection();; ^% f% {3 Q+ M( J* c f- f3 B8 S M
- extrudeBuilder->SetSection(section);
- X" O2 `$ o* g* y -
6 V8 b8 f1 W: [# ~ - vector<Features::Feature * > featureRule(1);
- ~& O% d: F4 ?' V3 [9 I+ A0 X - featureRule[0] = sketch->Feature();2 y# y" ~ k9 X" u
- CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);, V8 u) a" w; n$ u4 h
- std::vector <SelectionIntentRule *> rule(1);
- Q+ ~% C0 F1 z% P. N+ ^ - rule[0] = curveFeatureRule;
/ z7 ^. h1 o/ |3 @3 n9 Z9 [$ \) _ - NXOpen::NXObject *nullObject(NULL);- G5 ^1 m( |# S" ]! f
- section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);- q& ~5 A6 l5 r% M9 I
+ h- s. v7 \2 H- extrudeBuilder->Limits()->StartExtend()->SetValue("0"); K% |# H5 h* s0 F
- extrudeBuilder->Limits()->EndExtend()->SetValue("100");
! Z9 S* K2 @0 V$ ]" f9 U - Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);
7 \+ E" \3 C2 h& L/ k/ Q4 } - extrudeBuilder->SetDirection(direction);
# _5 U( K3 c1 u0 @, e9 O1 @+ }2 E - p- _6 l8 U+ q
- extrudeBuilder->CommitFeature();
+ {/ z+ u- a$ s8 a: P% f f - extrudeBuilder->Destroy();, M4 @/ U0 U/ j: F/ C' i) Y4 c
- * l4 Y9 [& S( \) w# u, Q
- }
复制代码
% [9 x7 W) d* B) e. O" t" C$ J3 i/ T7 h9 L1 h
这是一个拉伸草图特征的二次开发源码,仅供参考2 Z" X9 _2 Q% m4 z9 s/ w4 Z
$ j! g; ]2 A8 \1 t8 T: z9 O
9 @, \( P! m/ t A& J- m$ ?" ?, o ~9 @. p L
6 m- f2 g% U: \7 u0 I) H |
|