|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
这是录的日志里草图偏置曲线里的
' f# e. `& a$ d+ t2 G: \0 HNXObject nXObject2;
: G {% r! }+ v2 f+ A0 N nXObject2 = skeTChOffsetBuilder1.Commit();, T$ B, |( r" `" @
7 Q, @7 a$ I; } NXObject[] objects1;. c2 c' f' p- M1 V
objects1 = sketchOffsetBuilder1.GetCommittedObjects();
3 z) X( n6 v b我返回了nXObject2; $ D$ B5 k/ H7 T x
并录制了一个草图拉伸的日志 里面这么写的; B+ ~) A$ S! k; Q
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];& k1 ^8 Y) L) p0 e$ \1 ]$ l4 W2 w
NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
3 ?9 q. g! R, d3 D4 Y features1[0] = sketchFeature1;
+ y: s7 I& k# d5 I8 ~ Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");- ~7 k% d u7 B0 f, _# ^' X7 E
Line line1 = (Line)sketch1.FindObject("Curve Line4");
- X) r; L( F" ]+ G H Curve nullCurve = null;
% y& r x& M+ j. T- _& a CurveFeatureChainRule curveFeatureChainRule1;, v; j$ `( b6 z; B9 M1 U& O
curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);
+ x) b0 Y( h/ f' p) o1 L ; o& }. X P: B
section1.AllowSelfIntersection(true);
+ n, T% N1 C7 z: x: v% m. Z( v9 u ; M3 ?1 T* I/ _* R' R9 R, U! T
SelectionIntentRule[] rules1 = new SelectionIntentRule[1];# M- L" C5 q' T( b
rules1[0] = curveFeatureChainRule1;+ P7 T# b& a1 Z' U( f4 m
NXObject nullNXObject = null;
9 q7 E! H6 D3 j' }# X Q Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);/ r, ?% ?* N- N
section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);
: r1 b& h9 j3 s' g# {我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
" y2 @0 }4 X8 k* ]+ N0 ]3 | r改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;; I4 U1 A" X" l
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;
/ S; W9 O" d+ l/ D+ b% r% \2 E; O7 d+ [. g
再录一段没有草图的拉伸
' F# @' W* M2 i+ `' l/ j# W NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
2 O: Z4 Z! z% t$ K NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject2
" `8 O* G( Q. ~9 c2 Q5 O* ~ features1[0] = offsetCurve1;
0 v5 s/ ]" V$ }( r- v. v workPart.Features.SuppressFeatures(features1);9 q3 v6 o* `: P4 H4 H+ W/ P
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;8 l7 R7 Q+ ?# C8 u
- C- v8 H8 o# R3 e9 o
求高手告诉我下怎么转换7 y6 I* l) d3 n4 M( t
|
|