|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
1 m# o3 Z' K$ f- void skeTChTest::extrude(Sketch *sketch)
3 `7 u/ n2 x; ?7 h - {
( i2 ?4 m- c7 w - Features::Feature *null_feature(NULL);
9 g- N: X1 m" _ - Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);
: K. B" k6 f5 d - NXOpen::Section *section = workPart->Sections()->CreateSection();) G* n$ \& k+ D( V- ]
- extrudeBuilder->SetSection(section);: w7 Y% Y% \" z
-
$ G3 l6 }" K4 g0 n( p& v6 O1 Y - vector<Features::Feature * > featureRule(1);2 A9 D N9 d+ {0 y" e, p$ z3 Y
- featureRule[0] = sketch->Feature();
$ N4 F) b a/ V+ ? d - CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);
: N& O) @2 K l) n$ M* V$ n - std::vector <SelectionIntentRule *> rule(1);/ e3 `; L* |( |5 {8 O2 j0 N
- rule[0] = curveFeatureRule;* |" ?3 c& @5 }5 C: k! O
- NXOpen::NXObject *nullObject(NULL);0 p" j5 s* ~' i, }+ [
- section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);
' Q/ J" H- A- q; _7 H
3 E" _: f# I5 Q! g7 v' Y- extrudeBuilder->Limits()->StartExtend()->SetValue("0");4 }+ k. t$ l' ^. @
- extrudeBuilder->Limits()->EndExtend()->SetValue("100");% J: k& Z& T# K! V, r
- Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);
" ^0 C A* E3 I) _ - extrudeBuilder->SetDirection(direction);
8 W9 A" d0 ]2 X- p: c
% C" H4 L$ i) _0 Q; j- extrudeBuilder->CommitFeature();! h% k6 I1 v9 M) L
- extrudeBuilder->Destroy(); I: ~- E9 {# P
H! `7 I; K6 F k$ ~. r- }
复制代码 9 Y5 C4 h" p* Y1 w; f+ o
7 i3 j1 T' Z3 ?0 ~ d1 U7 B
这是一个拉伸草图特征的二次开发源码,仅供参考
5 q0 ]+ H1 Q( \5 \7 j3 D9 d& F
4 `9 I; Z0 I2 L8 ]8 u
, Z% Q4 I& B4 b1 ]$ f6 M) P# f$ v7 W' |
+ Q3 j0 @5 E9 X" M |
|