|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
这是录的日志里草图偏置曲线里的! M! U& u4 c" s' h4 U# n" h
NXObject nXObject2;. P3 Q# q9 {0 c9 o0 ~
nXObject2 = skeTChOffsetBuilder1.Commit();7 d8 U& w F! [8 i7 _( O
+ v/ V- F3 u/ n" g NXObject[] objects1;: X4 o9 m" D# n" O
objects1 = sketchOffsetBuilder1.GetCommittedObjects();
. Q" p! J) c' m' V我返回了nXObject2; + l" F; ~0 G5 n' H
并录制了一个草图拉伸的日志 里面这么写的; ~) A, i$ q- L) n0 o& g3 C: ^
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
- s& B9 d9 s0 `6 c) x5 d% Y- \ NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");4 G P8 a; M. a7 R; `2 ~
features1[0] = sketchFeature1;
) i& f* n* [8 L) E; h5 Z1 e( b2 q Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");
& h- e9 _& i$ ~ X; U2 q: ] Line line1 = (Line)sketch1.FindObject("Curve Line4");3 r+ u3 b( g, K! p9 @
Curve nullCurve = null;
. l( q2 I. i$ m4 E7 B CurveFeatureChainRule curveFeatureChainRule1;( w3 \: c6 F: h" a: c1 f' `
curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);
4 h, I2 ~$ M. Q5 k u1 ~% a2 \6 [ ) _! v$ q# L6 g4 ]: v, u4 O
section1.AllowSelfIntersection(true);
# W! O& l5 J4 q! C9 Q! {5 ?
) m6 T+ j( }9 V8 n SelectionIntentRule[] rules1 = new SelectionIntentRule[1];& n1 `5 L7 b# h+ l k* x
rules1[0] = curveFeatureChainRule1;
% G/ W8 m" S+ q. O" z9 K NXObject nullNXObject = null;
2 N2 c/ Z* d$ T+ Z( F9 z Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);
) P- m H% F8 N4 b2 p5 @ section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);
' R& R7 {0 B/ U9 J我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
2 ~0 s# G" e" ?; j( y改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;" W, Z' b; B3 X/ G
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;6 V7 [3 K' T5 V7 A, R3 d
0 U% n8 Z ~3 u% W2 l. W再录一段没有草图的拉伸( b( z' t; d/ _3 {# ^- O
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
6 U: e. l4 O# Q* J NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject2
) [# Y# x K% P features1[0] = offsetCurve1;
* ^5 [) Y3 g/ G8 K5 ? workPart.Features.SuppressFeatures(features1);
$ x a" Z# P& F) R: @1 r它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;
* e. M$ q( \7 a5 w
& w2 `7 |4 u- k* Z求高手告诉我下怎么转换
, L: q: l% F* X8 U* z6 u+ y |
|