|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
+ b3 e% ?$ m$ y1 Y E- void skeTChTest::extrude(Sketch *sketch)8 c) B# I/ }. `1 M3 N- ]
- {6 s& e/ G' o6 A$ K4 x# A& T& F
- Features::Feature *null_feature(NULL);& j& X% A; I0 g7 p1 l4 ]8 m
- Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);
* F9 p1 u1 a# x) y - NXOpen::Section *section = workPart->Sections()->CreateSection();" R& P8 k5 j+ J- J. A. E
- extrudeBuilder->SetSection(section);* P }8 o9 W! _, W9 e! i _
-
' p( h6 X7 f! n* U. M: X& w - vector<Features::Feature * > featureRule(1);( n0 ?; `7 r7 N. T5 c/ f
- featureRule[0] = sketch->Feature();
+ V4 H, b" E$ ] - CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);( d1 J2 g) u/ w5 v9 _5 ?# b& B$ C% b
- std::vector <SelectionIntentRule *> rule(1);
0 e* y) w' e$ j6 j9 w: S - rule[0] = curveFeatureRule;7 J. P/ g" p: ^% l. b+ e. B& o+ \0 N
- NXOpen::NXObject *nullObject(NULL);
* ^3 P- |% o7 l) h - section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);7 ^! F z/ g l" {& V5 @$ g
0 A: t. @7 P/ O6 x- extrudeBuilder->Limits()->StartExtend()->SetValue("0");
2 a2 b- S' r1 r4 a6 U% n. [/ w - extrudeBuilder->Limits()->EndExtend()->SetValue("100");
+ F( [& y D" ^6 Q2 |' ^( P - Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);
. r; _' z2 s: b O" v# j - extrudeBuilder->SetDirection(direction);
! ^3 s+ p9 L( z2 g( E4 {
0 \2 U" F( p0 x1 x- x, h. g- h3 c- extrudeBuilder->CommitFeature();
' M3 v' w" f, n* i - extrudeBuilder->Destroy();& w+ m# T; l" U4 N+ N( P$ ~
- ) o- J* q: M% ^& k1 c! {, x6 n' j
- }
复制代码
# s! l, Z& i) x' Y
0 @7 @3 r, v: n这是一个拉伸草图特征的二次开发源码,仅供参考
! o# @ F) X5 \0 c$ i' T9 c' |6 q( _# @, ~
* x; A7 q) G! r% e; n$ ~' ^3 b w: i; \: `( ~2 v( o. W0 P9 [
* q! Y$ w8 z, W; k' k |
|