|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
这是录的日志里草图偏置曲线里的
' I7 d- `# L* q1 c5 |# WNXObject nXObject2;( M) T, w/ w( l" _5 e. M0 D% r
nXObject2 = skeTChOffsetBuilder1.Commit();
) H3 F: H$ ?, ]) c 5 Y, |$ |/ o L; e% Y
NXObject[] objects1;4 ^& F0 J9 h U8 {: i
objects1 = sketchOffsetBuilder1.GetCommittedObjects();2 w' F( s9 i; G
我返回了nXObject2; & Y8 L6 F2 f. g1 d" D9 n0 {
并录制了一个草图拉伸的日志 里面这么写的* b1 G: |; k1 O6 \; J9 G2 K
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];- r, p) J) T, f& E K. L
NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");3 M, |' ~* ~2 T$ }& y: r0 h
features1[0] = sketchFeature1;" m4 T2 r/ D& _3 W$ V8 M4 r. _1 `
Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");
/ Q) V9 C t: h5 ~+ G- ^4 s. h Line line1 = (Line)sketch1.FindObject("Curve Line4");
# w" H ]$ m! m1 B$ J Curve nullCurve = null;, T3 G7 Y6 P% ~8 o
CurveFeatureChainRule curveFeatureChainRule1;
; w& l) c( Y) r+ F+ u- F, T curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);( L! o+ e4 M( [& j! J& D, d! w
}$ D$ C' y+ a% w8 x( D* h section1.AllowSelfIntersection(true);! u( `1 }4 B# M& ^
& g4 g% F# n5 [5 V' R( R% ~
SelectionIntentRule[] rules1 = new SelectionIntentRule[1];2 u3 w) _: }( O6 z# U1 j
rules1[0] = curveFeatureChainRule1;
" l- d6 B8 l, l3 z NXObject nullNXObject = null;
- F0 T" r' A& I2 G5 x6 [/ I* R+ B Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);
) \+ g* z$ W9 J% ~) a. y; |+ n section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);
( C$ }' P, C) A我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
7 W; e- ~0 b' L4 w; B" y改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;% O1 H9 A$ _7 L n' H) a# V
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;
: n$ y4 Z. N2 }- C8 z% z( \
. N( Y' _9 Y$ o, z- c再录一段没有草图的拉伸
, Z z- J3 ]! h NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
$ o4 h3 N( v y( x NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject2
& [( w- [8 T3 r4 o5 S features1[0] = offsetCurve1;
1 v# P9 Z/ i) b; f' `( j- F& H- r workPart.Features.SuppressFeatures(features1);, c$ P: m& u3 Q# [3 d3 _% G
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;7 {, [, T0 `* G3 I
7 J* D: H; M9 J) w4 o( a8 H! _
求高手告诉我下怎么转换
, x. T% D% P$ m! q4 r |
|