|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- 5 g. {" f* Z$ V9 K. ~+ p
- void skeTChTest::extrude(Sketch *sketch)
$ i6 h2 M+ L& u. K, I - {
2 s" g b x7 Z - Features::Feature *null_feature(NULL);) A C' C8 }2 x$ w% I
- Features::ExtrudeBuilder *extrudeBuilder = workPart->Features()->CreateExtrudeBuilder(null_feature);
4 R' h/ F7 ^! @' i$ f4 Z! r - NXOpen::Section *section = workPart->Sections()->CreateSection();. j0 M- b* c! b& y
- extrudeBuilder->SetSection(section);" v. _+ Y* v( ?9 X2 Y" q' F
-
9 E# A" x3 J% s M6 q - vector<Features::Feature * > featureRule(1);& O; S: i5 u% {- E/ Y3 f6 z
- featureRule[0] = sketch->Feature();
; i0 d8 L o! J9 c; @" \ - CurveFeatureRule *curveFeatureRule = workPart->ScRuleFactory()->CreateRuleCurveFeature(featureRule);, Z/ k \/ Q& `
- std::vector <SelectionIntentRule *> rule(1);
- H" W9 j% d7 `" u. @% r5 G/ p$ ~ - rule[0] = curveFeatureRule;
# k& z7 p0 f9 m; j5 ?$ C. D0 g - NXOpen::NXObject *nullObject(NULL);2 |# t6 ]3 |1 g" D, v6 Z9 ]! J
- section->AddToSection(rule,nullObject,nullObject,nullObject,Point3d(0,0,0),Section::ModeCreate,false);/ k3 o2 g- W6 n0 G o! K# r
- , }, @6 G) G0 Z' g0 b
- extrudeBuilder->Limits()->StartExtend()->SetValue("0");" v: _# k M0 e/ t0 n9 P7 _
- extrudeBuilder->Limits()->EndExtend()->SetValue("100");
) i( s i! ^8 G; w R - Direction *direction = workPart->Directions()->CreateDirection(sketch,SenseForward,SmartObject::UpdateOptionWithinModeling);! |! N' ^$ @9 ^ M
- extrudeBuilder->SetDirection(direction);0 I' I; q6 s) d5 b, G, r; a( e
- . w3 T9 |& i) [
- extrudeBuilder->CommitFeature();3 O5 I% n( d0 X7 n4 R; V
- extrudeBuilder->Destroy();
% Q9 p% c! {2 \5 o, X
7 M. }5 S$ }4 [6 t- }
复制代码 . S; t" z! Z% r W4 B) Y3 O
9 S; e: O4 z& I4 j; v2 D+ S这是一个拉伸草图特征的二次开发源码,仅供参考# `$ J) Q' u8 i1 K
, S; h* }- M* M% S6 s& ~ z: u
v& }7 T2 H5 x2 f" e
; a8 v0 |( i( U. q. v
|
|