|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- ( w( D F+ N: q5 X
- void skeTChTest::extrude(Sketch *sketch)
8 L; `4 ^4 g) J+ A - {3 h: Y5 k* h9 D) B2 F6 {. l( M
- Features::Feature *null_feature(NULL);" b$ N+ R t' E2 i0 c, \
- Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);
: Z: }9 L0 V; m. b - NXOpen::Section *section = workPart->Sections()->CreateSection();7 D& i$ j- ~+ G2 S) p; J
- extrudeBuilder->SetSection(section);3 P( Z1 P; H, x5 d! Z2 R
-
) }3 E( H% D2 }+ Y; d - vector<Features::Feature * > featureRule(1);
/ E O" F( k1 T+ J: v - featureRule[0] = sketch->Feature();
8 B/ n$ @" H% T e; L - CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);
* B+ l$ c+ ]: `0 G8 P! A5 ? - std::vector <SelectionIntentRule *> rule(1);
" r0 L/ w, n7 U% N- ~: K( a. U$ L - rule[0] = curveFeatureRule;; }& f3 C# a; J |' Y0 X% p, k
- NXOpen::NXObject *nullObject(NULL);
" G: O" J& _* L$ n ?8 f. `; n - section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);4 _7 [- P' O) M! U9 o5 v5 j& T
- ( k* V) }, p: h# l# [9 q
- extrudeBuilder->Limits()->StartExtend()->SetValue("0");
" w" U2 x- x) K' p+ @* @- R& Y3 a - extrudeBuilder->Limits()->EndExtend()->SetValue("100");
1 ~: V# U7 v. S; {9 Y - Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);
, J( }3 n! h% d# e, n9 ~$ v1 X" l - extrudeBuilder->SetDirection(direction);& f t* Q' A+ J, o
0 _. [5 u. ^0 q. h- extrudeBuilder->CommitFeature();( H2 B" I* N# @: D5 V) r+ Y8 v
- extrudeBuilder->Destroy();, c( N; T. l3 d7 r4 `( ^2 R7 v
0 p g% l& ^4 D# T2 v: y# X- }
复制代码 * s! z% s6 y0 r5 S3 y' W5 c! M
6 p! \" u- Q) a& B+ w/ V9 y这是一个拉伸草图特征的二次开发源码,仅供参考
+ d$ e+ l4 @- x" H: E7 a! q6 X+ a" N" P! M8 u5 C! y! d
% v D0 J/ D2 u( b8 ~, M
0 q3 e a5 I: X6 x( M! q* j7 l% ]* n. o" _+ `
|
|