|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
这是录的日志里草图偏置曲线里的! W% y" ]; x7 t1 s
NXObject nXObject2;$ _9 p! N$ r$ p) z3 ]
nXObject2 = skeTChOffsetBuilder1.Commit();
! H2 ~4 N# ^3 g7 c0 I: D' n; k8 K " c+ P3 O8 S0 Y" ~
NXObject[] objects1;0 ~- w" ?, ^! a8 _# A& z' a
objects1 = sketchOffsetBuilder1.GetCommittedObjects(); Y. K7 x& A/ K) v* p/ P/ l
我返回了nXObject2; ) h& Y, F0 g1 |% V' j" l
并录制了一个草图拉伸的日志 里面这么写的
* t0 H+ B) D* v" x6 D9 MNXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];. r& N% L) J" V( m0 A
NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
/ B. W' G- W. |; {! K features1[0] = sketchFeature1;& `8 l% c1 S3 ]2 \0 p* @6 i2 A
Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");
. U. v+ C) \ T. C) R Line line1 = (Line)sketch1.FindObject("Curve Line4");
4 L! ?; |) s3 U* m1 I( b Curve nullCurve = null;; b2 N) {% V. s0 V
CurveFeatureChainRule curveFeatureChainRule1;' O6 M" M$ S7 P4 q4 i. H
curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);
5 R1 \: k" b' A: g# H0 K
; X2 O$ j% v* Q( `# ?" G% c section1.AllowSelfIntersection(true);: L; `8 P, n3 s* a
# }7 \; `1 R) ^$ N
SelectionIntentRule[] rules1 = new SelectionIntentRule[1];& N! A# |% q" C" M
rules1[0] = curveFeatureChainRule1;4 u( a$ N# ?9 r# _3 O! m# C+ P
NXObject nullNXObject = null;
2 V6 H1 v5 A) _* F: x/ L5 e3 G Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);& _; X$ o- g0 V: l7 i$ P
section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);8 X8 E/ _8 v, u% ]
我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
5 X8 j" `, M6 W' V; x1 o改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;7 z) h p8 y* K! P1 I+ i" m2 a
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;
/ V" N }9 Z8 T. _( w- z" M. j7 P" C1 b+ \
再录一段没有草图的拉伸
) b1 D+ C! f0 z+ ]2 a- t F NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
' z n! k% e* a" D) B7 n NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject20 m; n! W- j8 v) X3 ^$ o
features1[0] = offsetCurve1;# R, Q4 _8 k; E& m& n, a( X
workPart.Features.SuppressFeatures(features1);
* K v! v; l: ~它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve; c# h2 Y* [9 ?! w* G: L
' y5 B/ ^$ t& C& R% X求高手告诉我下怎么转换5 [8 g4 U, M1 J
|
|