|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
这是录的日志里草图偏置曲线里的/ v! j, ` E) U" I) k4 T2 a
NXObject nXObject2;
. P% |- }, q2 t ?" _7 w nXObject2 = skeTChOffsetBuilder1.Commit();
6 l7 {( y3 g' } ; Q) h* p* U4 L* F H
NXObject[] objects1;! S' t0 ~+ |4 m, q/ h* @
objects1 = sketchOffsetBuilder1.GetCommittedObjects();
7 Q& f8 g! x2 n, g我返回了nXObject2; 2 N$ ~: E' s3 Y0 j( t( x
并录制了一个草图拉伸的日志 里面这么写的# V9 n( y G0 x, w) ?" m1 e& A+ ^2 q- _
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];/ u' @2 s. b9 {! f
NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
* p$ Y5 X) q/ h, L6 M* }( S% o# \ features1[0] = sketchFeature1;
; C" D) j% \2 O# V' j$ y& L Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");
* X7 O- G9 r9 F. I; _ Line line1 = (Line)sketch1.FindObject("Curve Line4");/ A# W* s- _- E u5 {
Curve nullCurve = null;' p7 r# }& b6 @9 R9 B9 L5 o/ C4 d
CurveFeatureChainRule curveFeatureChainRule1;0 H0 p" l. E* Y9 _9 l
curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);5 a1 c/ }' `8 x% L+ O5 w+ G
0 o' d9 I9 M T; f0 B section1.AllowSelfIntersection(true);
( n {. Z% D, r6 r+ v8 x # w1 `# {5 z1 }. e1 Y2 y. X! _
SelectionIntentRule[] rules1 = new SelectionIntentRule[1];9 c! u# B+ ~7 ]: q' M3 A2 E9 o
rules1[0] = curveFeatureChainRule1;) Q5 O* n& o- S& M
NXObject nullNXObject = null;
" ~1 ~9 C4 Y- `3 n) y( X Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);9 @) m$ F S; t
section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);; W& G7 \( i. t
我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");) L/ U; _. m- I
改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;7 n$ s! J9 h# g, X S
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;
- j8 t6 p4 a+ o: s$ X! }
+ v- i* @+ b' ~4 C) y# g再录一段没有草图的拉伸
& d, O$ N# v* t NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];$ ]* V3 \0 [0 q% }2 z& A7 j; m
NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject2! r, b$ h" ?5 U; g$ `
features1[0] = offsetCurve1;
+ A8 W8 j2 D6 Z: h C workPart.Features.SuppressFeatures(features1);* K" k# N# p, \4 E9 _) B- a
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;
. d7 S8 t y. E2 \. n1 @, e# p' S0 s# o( ~
求高手告诉我下怎么转换6 X% x5 b! q% y3 l+ V: W5 R
|
|