|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
这是录的日志里草图偏置曲线里的
( l3 {7 l# M1 iNXObject nXObject2;
; t, \* l w, E$ y3 w nXObject2 = skeTChOffsetBuilder1.Commit();
# Y3 K% u2 o! o J 8 m& A$ [& q9 j. N
NXObject[] objects1;1 x" m6 \: ~+ c" V( e
objects1 = sketchOffsetBuilder1.GetCommittedObjects();* U6 S1 V- Z& B0 ?$ ]" ^
我返回了nXObject2; 9 r* q& G5 r( n4 b8 z7 Y2 j
并录制了一个草图拉伸的日志 里面这么写的
6 O' e+ c& a7 \" W0 F/ R6 uNXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
x( V* s" q1 E9 H6 B6 s NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
" d: Y- B2 v( F% m) s features1[0] = sketchFeature1;
, H* Y5 P. T4 O Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");
) b/ w& I' T: i6 ? Line line1 = (Line)sketch1.FindObject("Curve Line4");
: i" O7 l7 Q6 B Curve nullCurve = null;
5 l5 b$ m. [! v3 h6 x CurveFeatureChainRule curveFeatureChainRule1;
& f* T4 A3 g; Z8 u6 R# l j curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);
: Y- q3 h" H( N8 B4 q
) M' ^( u7 Z2 C6 K$ g" G section1.AllowSelfIntersection(true);2 t6 i8 Z! F: |6 K) R% _
4 A- _& x% y* l. Q' B* Y; X. o SelectionIntentRule[] rules1 = new SelectionIntentRule[1];* f) [9 R b8 T5 S! `
rules1[0] = curveFeatureChainRule1;+ W; t4 X8 r- ^
NXObject nullNXObject = null;! S* o, i' N* [3 [9 M
Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);9 _, {6 [4 J6 z- X* p
section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);
( p/ V( P- U4 t& M; I% A3 e我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");/ i, d- Z7 T" I5 N; r V `3 a
改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;
( ^$ ~. |4 w4 V9 d' g$ I8 o! d+ n; W1 x它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;: V5 ?8 b+ X* V2 E
& i; ?: K0 V# d再录一段没有草图的拉伸
! M, e. y2 m8 H( Z8 S0 R- p1 [8 Z8 s' Y NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];4 C; m4 T4 g$ a9 f/ k( v8 O+ f' M6 X
NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject2
% y+ r( O; I% Z$ e0 W6 L g features1[0] = offsetCurve1;7 c% U0 S; F! d
workPart.Features.SuppressFeatures(features1);- r' E. g- w6 V8 [5 k L
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;/ D7 @$ L7 S! _" P; A- x( j$ r
4 x# d' q g4 o6 O求高手告诉我下怎么转换% x# P9 `7 |/ d( z7 W4 A$ C7 o
|
|