|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
这是录的日志里草图偏置曲线里的0 w( F3 Z! r, ]5 P" d( p! S
NXObject nXObject2;, m2 q, x' w, a6 ?! G
nXObject2 = skeTChOffsetBuilder1.Commit();. y9 l% d0 @( @" S ^
$ Y+ m8 t8 U4 ~) X NXObject[] objects1;& h, c; z* V5 ~# T3 G8 r8 E
objects1 = sketchOffsetBuilder1.GetCommittedObjects();9 @" ]( k* Q+ {: `1 T4 P
我返回了nXObject2; 0 q9 b7 T* U, R3 ~$ W
并录制了一个草图拉伸的日志 里面这么写的+ J! {1 j2 Y4 k" K
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];4 }( q9 ^' G6 Q A
NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");. G! d" T9 s' U& P
features1[0] = sketchFeature1;$ N6 ]* ~# V$ {) ]1 N$ q9 }
Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");$ r0 f) N5 V1 F$ _/ j6 r
Line line1 = (Line)sketch1.FindObject("Curve Line4");
( H% A" `5 e( A Curve nullCurve = null;
7 t. z' z( q0 P# ^; U CurveFeatureChainRule curveFeatureChainRule1;
+ ^ W& M6 `6 K( \- m T curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);
?: d9 R A8 f9 U9 b3 ^ 0 g; A( c; z. Z( v) W# D; F
section1.AllowSelfIntersection(true);9 f% \" s( i/ l$ { O6 G' V! g, _9 c
. Q: a0 Q: ~3 J4 g2 n/ ~ SelectionIntentRule[] rules1 = new SelectionIntentRule[1]; [/ ?" g) d9 K$ U- F
rules1[0] = curveFeatureChainRule1;
; f$ y: w0 b, A! R6 |6 @ NXObject nullNXObject = null;
# w7 c9 ?( o( k u4 H7 t& f; R Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);' O# g$ s3 b: o1 e0 b1 g
section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);
% ?7 e# T1 X! p. T: q+ x我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
' }! H) f0 u( }7 y% I/ J改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;
/ h% Q/ e1 S2 b+ e5 B3 Y% D( g. p/ c0 F它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;' D! _4 w3 a4 G# p8 C* p/ s! G
7 F: F, B+ c9 ~( S) ]* Z6 A
再录一段没有草图的拉伸
o& \' q( r4 k8 x/ b; ~ NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
* J# u& c- \, l1 C NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject26 A& h, s& ~$ l
features1[0] = offsetCurve1;' c/ a9 j5 `0 |3 c) m2 a
workPart.Features.SuppressFeatures(features1);
3 }) ?) H) W1 D$ a& i, E5 a它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;8 ]) v Y5 w, [6 T3 o
: v4 O( p5 h, l. m: s
求高手告诉我下怎么转换( N, C* V0 Q) `
|
|