|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
这是录的日志里草图偏置曲线里的4 b; p# M" [& I" E* M* q
NXObject nXObject2;+ a) U, K6 a. ^1 i* w3 ], A
nXObject2 = skeTChOffsetBuilder1.Commit();( T; l/ c8 T0 a' T; H- }
8 u3 s; M4 @( O
NXObject[] objects1;
2 v. z+ x7 p! x: \4 i4 l% K8 ^# l7 A5 U objects1 = sketchOffsetBuilder1.GetCommittedObjects();
0 K2 L8 m6 B6 j: Z* ~% U我返回了nXObject2;
. ^+ A; J) d# c% N* ~" ]6 b并录制了一个草图拉伸的日志 里面这么写的' ?3 z# |6 W# [* j6 ~5 ^) i: w4 b
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
# m# O8 H9 H. V& X7 w( _+ ] NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
. t0 w5 Q9 f* z6 q3 d$ b, M features1[0] = sketchFeature1;
/ s! g( E( R0 [* W( _4 @ Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");6 \8 r8 V4 v6 J0 i' x9 R
Line line1 = (Line)sketch1.FindObject("Curve Line4");: \: H3 v% @9 R* g3 e8 G
Curve nullCurve = null;
& r* k# W) G; ] e, W CurveFeatureChainRule curveFeatureChainRule1;
2 o# z% u% \2 _- Q* T curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);# w' u4 @: k4 { J! c& Y
9 ?) C: r# e* f! U
section1.AllowSelfIntersection(true);
; H3 W+ J7 B% z 6 E0 h; ~! G8 h4 S
SelectionIntentRule[] rules1 = new SelectionIntentRule[1];/ y0 G+ a' }% _; `; X* Q
rules1[0] = curveFeatureChainRule1;
, ?" }* p4 q0 J5 g& _ NXObject nullNXObject = null;
/ B7 u8 h% w/ l. t! s7 V+ b# S5 Q, a Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);; p& o" x" B5 M' P, {3 Q' t
section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);
8 |+ {; ~& d8 U8 N我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
! L' {9 |: S# O: _: I7 s改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;9 b! _& A8 }1 _4 t2 C4 I" B( b
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;& L# U2 }7 F. `2 |7 O
( I; e0 w5 G$ T再录一段没有草图的拉伸
/ A! P" o5 q# w NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
7 u3 [7 T; ]4 t0 Y2 Z NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject25 Z4 {* A( q* T! }
features1[0] = offsetCurve1;0 Q2 K; u) |6 Z( X3 g2 w
workPart.Features.SuppressFeatures(features1);2 @+ z2 h# [% }5 t {9 A
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;
( G% }' g7 L0 ?6 ]5 ^$ P; b, r% ~- z& L* T# a
求高手告诉我下怎么转换
; i" Y3 w# }& ?# t |
|