|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
这是录的日志里草图偏置曲线里的
/ R) Q K; B* J3 }* p0 s3 j6 gNXObject nXObject2;
5 Y; y% ^5 [9 ?# m/ K# j2 V nXObject2 = skeTChOffsetBuilder1.Commit();
! A: Q! l% ~0 y Q0 H , W, h: {' v7 l( E5 p% z
NXObject[] objects1;- F& I M, n( u& o& G$ f' [3 z
objects1 = sketchOffsetBuilder1.GetCommittedObjects();9 D: r, B; P3 M
我返回了nXObject2; . W4 J9 ^: o {' U: |( d3 _
并录制了一个草图拉伸的日志 里面这么写的
) V9 d# _! X' M& H. V, GNXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];' S, \$ Z& U* l% ]/ n: H
NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");% s8 ^; L' e) c7 C9 r. t
features1[0] = sketchFeature1;
, K! Q# D% i) y- s Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");
' F: J [& F* E9 T/ e" d Line line1 = (Line)sketch1.FindObject("Curve Line4");# R% r. z7 O' `
Curve nullCurve = null;
; m6 u- V# x! i" \9 \ CurveFeatureChainRule curveFeatureChainRule1;
* |* K$ K6 f' |8 H6 ?- R curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);
' N2 p1 k0 P0 h' v- w# M' l - [+ j2 o- g3 H4 g7 F
section1.AllowSelfIntersection(true);, z$ N$ e7 }6 T
0 V6 }/ c0 L- ?2 K SelectionIntentRule[] rules1 = new SelectionIntentRule[1];
. g" ~& Z0 A; Z& J+ h( P rules1[0] = curveFeatureChainRule1;4 j& Z+ V6 i) T* j- c* J+ [& t
NXObject nullNXObject = null;
$ n5 h- J4 t! v Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);& X8 ]3 E! f" k
section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);- N/ @ u p5 B0 u; D! |
我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");0 n2 K* t$ ^6 F* ]
改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;( h0 y6 K0 o5 ?* M ^) O0 G
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;
3 ?' w: i! W2 \! M1 @: \% J/ C
1 p. [/ g" F, h, f0 N再录一段没有草图的拉伸; B/ b7 z; J' x( Y4 c: M4 c
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
! n2 o3 k0 {8 O+ ` NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject2
' z* J/ K8 H! I) H features1[0] = offsetCurve1;0 g0 T% |, {! [5 H
workPart.Features.SuppressFeatures(features1);
' B Y' p9 @2 }& k7 t" R. @+ g5 L; t它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;" ^7 C9 `0 {- e, ~8 h2 [" f
" b" Y6 d$ y! ]8 e' a3 b求高手告诉我下怎么转换
$ ?. \4 X4 n! h2 s |
|