|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
这是录的日志里草图偏置曲线里的: K9 U s. x1 Q; q3 V+ J3 m
NXObject nXObject2;" P8 k6 x: u# J
nXObject2 = skeTChOffsetBuilder1.Commit();
, o6 y; ]" z! A5 d+ I) N 3 x" y2 g* Z' g8 k3 L5 I
NXObject[] objects1;
0 K, [7 b4 I* |6 M: K/ b' C1 o objects1 = sketchOffsetBuilder1.GetCommittedObjects();$ b0 t, M9 v, _- W; w" E
我返回了nXObject2;
# Y' u0 [4 p3 E, S) ~9 F. R; T x并录制了一个草图拉伸的日志 里面这么写的
: p+ J( Y- s% |. TNXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
. X% \7 H$ H7 [8 e5 X- Z NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
; X0 q3 @/ w, ?' s features1[0] = sketchFeature1;- Y$ @- ], r; Y" h
Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");, Y4 `6 E @% [. K
Line line1 = (Line)sketch1.FindObject("Curve Line4");7 r) P. t# y! {5 [; i
Curve nullCurve = null;
! Y1 g/ g4 n' ?; K CurveFeatureChainRule curveFeatureChainRule1;
, n7 I+ v3 O! |* j$ K/ R9 Z curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);
$ O. G8 d8 i6 m8 U3 s5 ?3 m: ]+ _ 9 h U% s; y7 t
section1.AllowSelfIntersection(true);5 J! d* s0 Y, Z
" ]- @" ?( u# }8 y4 f) `
SelectionIntentRule[] rules1 = new SelectionIntentRule[1];$ \7 a1 ~( o; s" N1 ^
rules1[0] = curveFeatureChainRule1;. ^3 y4 C; V# q7 @ B
NXObject nullNXObject = null;
0 l* M) n" {& J* c4 H' B: k- g Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);
& `( v- t! W- b3 s- L, N section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);7 |1 E7 Q2 t+ @9 O* ~
我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
3 M' y) a6 Z* {$ N7 `! U3 W) @% M改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;) _6 B+ _" P1 }
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;+ g! f* {1 h- i+ h3 Z7 {' ~8 [
3 J5 W8 b; Q# _( } {# a2 U, ?再录一段没有草图的拉伸
& y7 n6 B5 u) h1 \1 C8 c6 ]; H NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];) d7 s& t4 q% [" n
NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject2
' g7 a% A @9 B2 Y' E6 H features1[0] = offsetCurve1;
- [0 o! L2 r2 }( L. w& E7 K workPart.Features.SuppressFeatures(features1);" ~( E; }& a' ]1 h5 Z
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;
% m0 e& @$ Z' Q" z
9 |3 j. C5 c) k/ f5 E求高手告诉我下怎么转换
[$ d# o5 d# u8 M2 U |
|