|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
这是录的日志里草图偏置曲线里的
6 ~( e' t4 S4 [( uNXObject nXObject2;! @' N! |, `6 v0 W
nXObject2 = skeTChOffsetBuilder1.Commit();
8 I) W4 w' ?5 S2 }- K
& i3 Q7 f% _! c+ O- D2 B# \ NXObject[] objects1;; m% V' C2 V9 G- X. n5 [( z! p
objects1 = sketchOffsetBuilder1.GetCommittedObjects();
* k# d9 b# m# l2 A m/ z4 c C7 }5 Z我返回了nXObject2;
: n9 {7 t. ?# A8 ]1 Y并录制了一个草图拉伸的日志 里面这么写的
; p: N: ~7 t) h/ w2 |! W# DNXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];" O+ n; J$ x4 y
NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
" M4 w4 Y& @# i, y features1[0] = sketchFeature1;
: v3 k, g4 F$ l3 f# J$ H0 G* h9 D Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");
; E4 F+ t) M# x0 d) |7 { Line line1 = (Line)sketch1.FindObject("Curve Line4");# P# Q- h4 J' K: o; E
Curve nullCurve = null;
0 _' i/ d) g- |2 B, q% H CurveFeatureChainRule curveFeatureChainRule1;4 E( w4 E1 f- r7 [0 ~! N
curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);
2 \. f5 X% X! O6 g ) u, _! V/ L6 K
section1.AllowSelfIntersection(true);' t0 g3 A1 Z6 \
$ v4 u/ x# |& s7 J8 X
SelectionIntentRule[] rules1 = new SelectionIntentRule[1];
. X$ p9 {4 Y4 D) x8 h rules1[0] = curveFeatureChainRule1;$ ^8 b5 ^2 j# o' J
NXObject nullNXObject = null;1 `3 o5 r0 X8 S
Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);
* c# ]0 c4 o! r6 ?8 h: P$ A section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);9 w; M' p& \3 ~% w2 ~9 I. K0 A
我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");2 Y) l/ C6 [1 O
改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;
8 s0 V1 K7 ~( x7 K% S2 U) i& J- J它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;2 |7 x; }& {4 U) S5 N
7 p2 [! E8 P. C) U再录一段没有草图的拉伸
# _/ d% q2 U3 [( l& k$ I' F6 @ NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];+ O5 B7 W0 ?- Z
NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject28 g3 m, |# ~( {6 S( @. p
features1[0] = offsetCurve1;
5 ~, _, l* M+ p2 S9 V3 y workPart.Features.SuppressFeatures(features1);
2 S* E! O# i5 Q4 b ?- ]8 V它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;- T. Q* ~: H( [6 X2 R
. q2 m& _6 U0 d5 _: L4 G/ R5 E' T# q
求高手告诉我下怎么转换 q+ Y! g T( M3 _0 E
|
|