|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- 2 I4 G8 J; c9 h( r Y. K
- void skeTChTest::extrude(Sketch *sketch), [8 l$ g- t& D3 y4 U j
- {
% n6 |: {; h+ N7 ^- [ - Features::Feature *null_feature(NULL);
# U3 A' Z1 O% s, a - Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);
- a' ]4 p! @8 t2 N% x) } - NXOpen::Section *section = workPart->Sections()->CreateSection();( E1 p2 i+ q2 g' g6 v6 y
- extrudeBuilder->SetSection(section);
% b" o( x9 s8 E: F - P+ d3 [$ h9 W' x$ {* t& l2 G0 G
- vector<Features::Feature * > featureRule(1);
* x6 D- ^& r* {$ x1 c5 J2 F" P, Y - featureRule[0] = sketch->Feature();9 k8 e3 a% D- W. {
- CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);" g3 y# c# ^" Q2 Y6 v
- std::vector <SelectionIntentRule *> rule(1);% s8 S' B4 d% ^) `
- rule[0] = curveFeatureRule;
6 i* [" \9 N7 ]. H8 u - NXOpen::NXObject *nullObject(NULL);& N% |! p) W. _1 M# H* e
- section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);
! F/ I/ s0 @7 G: G/ }. H7 ]! f - 9 Z9 R: K* V3 E3 X% _2 k
- extrudeBuilder->Limits()->StartExtend()->SetValue("0");- q( m8 Y+ x6 g3 a- V$ F$ V& v% q) z
- extrudeBuilder->Limits()->EndExtend()->SetValue("100");$ R7 D, X7 \9 Y* z/ D
- Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);
9 E# D5 ~+ S( p+ z - extrudeBuilder->SetDirection(direction);
, P) R8 Q$ z" O - 2 a( U/ n6 ~. @3 z ?
- extrudeBuilder->CommitFeature();; q! i& ^3 y0 n8 U; v4 G1 ^, J! M! r
- extrudeBuilder->Destroy();
) d# X- } U$ Z' j7 W9 K; l& o - , m4 U- x$ h7 H) S9 w# L R A
- }
复制代码 ' D+ r( t# O7 t2 ]+ h7 }8 M
- N# j# }" t8 ?8 z9 k这是一个拉伸草图特征的二次开发源码,仅供参考
1 Y+ U& \6 K {
( F; G: O& P- b- b0 @7 \+ U& M* u( p7 M
8 K0 g' }5 j/ T/ q
; r# R' Z- g1 t7 p- W1 x0 ` |
|