|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
2 R @+ D4 s7 f" ^' v- void skeTChTest::extrude(Sketch *sketch)
6 P0 k" R6 x* `6 t4 @: B - {. ]/ l# x6 S: e! |% R+ `6 f4 D- x
- Features::Feature *null_feature(NULL);! Y* {$ C" _, d/ h6 A! f
- Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);5 v8 i/ r/ x8 n8 a
- NXOpen::Section *section = workPart->Sections()->CreateSection();
: C( ]2 I& M: y6 b& w$ Q7 S% A - extrudeBuilder->SetSection(section);
' X! o# V; W% f& t: w1 [ - * i4 j, p0 [) `3 M) U8 M5 O; b
- vector<Features::Feature * > featureRule(1);$ F3 V# \; a( E3 G$ l4 f: G# \+ i$ j$ e
- featureRule[0] = sketch->Feature(); W( D9 k/ g( E' {
- CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);
6 f+ h6 o2 S( q$ | - std::vector <SelectionIntentRule *> rule(1);
g* Y& F9 ?3 |# N - rule[0] = curveFeatureRule;
% b. t( w. _+ V' Y2 x2 Z6 z* u. P - NXOpen::NXObject *nullObject(NULL);2 B1 y* h1 Y4 p- s% a
- section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);0 |, d' I7 i+ }$ H% V. E
6 q# x9 l8 D/ d* e c+ c- extrudeBuilder->Limits()->StartExtend()->SetValue("0");
7 s% }4 D' c3 K- q, S& p+ V - extrudeBuilder->Limits()->EndExtend()->SetValue("100");" u, q% H7 B# c3 x1 ^6 R$ U# k5 N
- Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);
! ?, w$ J0 c+ Q8 i+ ?5 K: R) G - extrudeBuilder->SetDirection(direction);
2 r4 N$ ~& h! n2 O9 q
2 l" |) A4 B+ H: N# ^- extrudeBuilder->CommitFeature();5 n4 n4 y8 V' Y/ v
- extrudeBuilder->Destroy();
4 Z0 `- P1 G$ F O/ G - : K* _4 o% [- h( p# W
- }
复制代码
# |7 I% K- ?7 V# E6 ?$ H t; g( v. c! s1 H# b6 v
这是一个拉伸草图特征的二次开发源码,仅供参考
0 d# L( Q6 y/ x% g& V7 i" `- o7 i( n9 \: A
6 o# d/ H& A1 ~$ k4 f# h8 _$ ]$ `& n& X7 V" y$ I
+ X' r6 v& z2 N$ X
|
|