|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
这是录的日志里草图偏置曲线里的# k0 {& R! A& e) D3 w$ }5 J
NXObject nXObject2;% G: m4 d f8 u- G7 X4 ~9 o
nXObject2 = skeTChOffsetBuilder1.Commit();
% D6 y P" ?8 W! h$ E1 S# @" g h ) v" |7 k" b6 ^+ Y
NXObject[] objects1;
. Y! r8 P7 t& n- s* Q4 ~* |5 H objects1 = sketchOffsetBuilder1.GetCommittedObjects();
( T' [6 k. U. A! [我返回了nXObject2; " q3 W) `! ~5 S2 Z4 n/ t' E
并录制了一个草图拉伸的日志 里面这么写的& C4 s% O8 |$ T( D, u3 q; c/ v+ n& Q% a
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
2 o( O0 A/ b& {3 A% {2 g4 z NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
( m4 V1 u/ z! F' M4 P% J+ ~ features1[0] = sketchFeature1;
; m8 q8 r1 e: {4 B/ G0 B% _ Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");6 o- Z" p5 X' ?5 Q8 v h+ X; [0 a
Line line1 = (Line)sketch1.FindObject("Curve Line4");
' F$ K* ~) K7 \4 f* q, }; `) ^+ C Curve nullCurve = null;2 ]3 j0 d' @4 T+ m
CurveFeatureChainRule curveFeatureChainRule1;9 a+ T8 c) W9 g& Q F7 H
curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);
& r7 h+ s0 H' p0 I " Q* k9 g0 x" C9 ]
section1.AllowSelfIntersection(true);
' c2 ?# u: D0 T+ {, u/ {4 a
% A) v' |1 V+ x( { SelectionIntentRule[] rules1 = new SelectionIntentRule[1];5 I/ t3 W+ G* O: I, s; D0 I0 \
rules1[0] = curveFeatureChainRule1;
4 x* M3 A8 j# T/ V* U NXObject nullNXObject = null;. F. Y' D% ]) F9 D( X: O; D6 o
Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);
/ U( g- t0 x3 g: y: F6 N% c section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);
3 v( w2 `$ h6 O2 r" n( a. j( p我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
+ r4 z, j1 q/ g$ P- J3 B; I( J改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;* M+ m3 K3 w/ l7 U6 o( r6 h! Y) H
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;1 I1 q2 k- T0 R, D9 P* s3 E" s9 x& H
/ j9 s( F8 R7 M* v0 b1 v再录一段没有草图的拉伸
' l5 R1 Q' w( d) j NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
) a3 ^0 X" J* q- I NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject25 J! h( v; |5 L7 W1 s7 z
features1[0] = offsetCurve1;+ a& u6 m9 i- p; E# a6 }) n$ q
workPart.Features.SuppressFeatures(features1);
: b% Z( ?/ H/ [% J K! C; z它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;# d, P, U% a" Z, i( q9 A
u1 O. m2 f2 c( ~# f
求高手告诉我下怎么转换
+ z# Y* }* E" }( r- v2 f |
|