|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- ) a7 j/ r6 g) Y: d. ^
- void skeTChTest::extrude(Sketch *sketch)
- g6 S) N' T7 a2 v& V+ z - {( k* s) \! I' b3 d! e: w
- Features::Feature *null_feature(NULL);
# y& t, k8 g; t+ h - Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);3 ~) U. W2 s6 P
- NXOpen::Section *section = workPart->Sections()->CreateSection(); ]: U; E c, }
- extrudeBuilder->SetSection(section);
7 T* O! Q- S& _/ f; B -
* D2 b% Q) ^! B. e& M - vector<Features::Feature * > featureRule(1);
$ R6 F( s U6 j$ h% Z' q# } - featureRule[0] = sketch->Feature();1 p. M$ _ o5 n' ^8 V# i6 k
- CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);! l7 g0 _8 C0 B9 t) J: J" B
- std::vector <SelectionIntentRule *> rule(1);; L* |# y; y( ^4 \. r
- rule[0] = curveFeatureRule;, R3 k0 d- S4 r
- NXOpen::NXObject *nullObject(NULL);- R0 _! d( ^: l# b) {
- section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);+ S8 g- y( |3 l1 G
7 l5 Q3 |" a& R3 s9 H- extrudeBuilder->Limits()->StartExtend()->SetValue("0");
- x! {' P% a" G* q# e! q/ Z1 U. G - extrudeBuilder->Limits()->EndExtend()->SetValue("100");9 i, z( ?5 a' Y& h& [
- Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);
: W+ O. p- d- F: d1 c- m - extrudeBuilder->SetDirection(direction);
4 q; i4 L! V# v6 G: J! Z; h - ( k1 [/ p) u! j/ g( Q* h
- extrudeBuilder->CommitFeature();) G9 w) u" Y7 w, S( a
- extrudeBuilder->Destroy();* R p" |( B# j" X2 z$ |6 _
- 2 P1 B# D+ }" J1 q
- }
复制代码 / l& }% K0 B! x! g% u
; o, q9 W( t" E- O% [6 ?这是一个拉伸草图特征的二次开发源码,仅供参考
d5 e- A8 Y' [. Q8 e, Z& t; d/ G
. [5 q3 T# Q- I" {6 i8 r% a) k/ V9 C/ ~3 v
9 l- s" p# A* |' T& ~! o1 ^- [" Z/ B! o1 h' o
|
|