|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
这是录的日志里草图偏置曲线里的
( \8 F6 i* }6 v$ VNXObject nXObject2;" M9 |: C5 c4 \- m9 o a% z
nXObject2 = skeTChOffsetBuilder1.Commit();/ M/ m8 I- i' p# f* g, U9 a
) N5 v# }% E- C. Y q5 q NXObject[] objects1;" n. r) O4 N* Q, F8 F2 @2 U
objects1 = sketchOffsetBuilder1.GetCommittedObjects();4 _& B+ H& `8 {: M
我返回了nXObject2; & e6 d; R: e" s2 v/ e* X. }
并录制了一个草图拉伸的日志 里面这么写的
, y, y% O/ f4 J% DNXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];3 h& p1 }3 m, q3 O) r
NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
6 p: s! \: `. t6 ^' b: n features1[0] = sketchFeature1;2 L \6 [3 V2 L5 m2 E/ y* s2 Q
Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");' r. T6 d$ ~$ v* q3 _, L; R. o
Line line1 = (Line)sketch1.FindObject("Curve Line4");- j' D5 D$ v% n# p+ k
Curve nullCurve = null;
% C m5 T6 v2 Z* q' O5 L CurveFeatureChainRule curveFeatureChainRule1;9 r8 }0 w7 }' \, H G
curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);
& b6 l) E% S+ O7 n$ v. h 3 w/ v' `3 P! C- C
section1.AllowSelfIntersection(true);& n; _6 v3 ~- G6 R p
0 X u" f6 e* x: ?6 @
SelectionIntentRule[] rules1 = new SelectionIntentRule[1];$ ^% `8 `& h' t2 N" r: b
rules1[0] = curveFeatureChainRule1;
- P7 U" W( Q6 N% o/ L4 W5 _' w/ ~ NXObject nullNXObject = null;
' f# |/ j) @" {% y+ n1 B1 o9 n Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);
9 i$ H2 x8 o' ~0 o0 U2 x* H section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);& l$ K! |. w1 d+ o( J
我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
. E" ^0 X4 g; \3 W7 A. Y9 W改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;- a) m Q; C4 X T
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;$ Q" J# _" f# m( P
' _8 }* S* Z) {. a& F& X9 ~! N/ c
再录一段没有草图的拉伸
3 C: _+ m' o" Q NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];" ?: a" H5 n8 |' k! R( u+ g/ z
NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject2/ f' Q! @- F6 \4 G+ Z# \: x- c
features1[0] = offsetCurve1;
' M3 A3 Z- ~$ X N workPart.Features.SuppressFeatures(features1);
1 B- ^0 c9 l, K" U9 F它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;
+ p) l0 e- A9 o t: z/ y9 }* V2 q# Z: Y! P
求高手告诉我下怎么转换& ~7 I# |9 u0 {
|
|