|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
这是录的日志里草图偏置曲线里的 ]/ n, a, c9 W" |; T; O$ u- }( ^& N
NXObject nXObject2;6 R% `. J9 O# N( `/ w7 |* D4 S
nXObject2 = skeTChOffsetBuilder1.Commit();
$ w4 ?, x$ ` N- ]2 O! V9 Y- q' n % R/ s8 b4 M7 O) n
NXObject[] objects1;
7 _' I# \ N$ z) S; _, c objects1 = sketchOffsetBuilder1.GetCommittedObjects();
9 }8 n: l' C* o' u r2 l我返回了nXObject2;
5 R/ J- ` ~' y+ h* ]; r并录制了一个草图拉伸的日志 里面这么写的
6 ]+ P" f& t2 ]5 A: ?, C6 Y1 sNXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];6 U: K: S$ o0 ?: N: U7 m- H7 w6 C9 a
NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");. N1 f1 p( Z3 C; h
features1[0] = sketchFeature1;
9 i: l6 Q$ K8 }6 h$ N$ v2 u Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");
. @! d3 b; s! U5 {) \8 T: s1 @ Line line1 = (Line)sketch1.FindObject("Curve Line4");
4 V5 A2 Y" Z& ~- v, a6 S. D0 n Curve nullCurve = null;( k0 |# b/ Y% O2 P
CurveFeatureChainRule curveFeatureChainRule1;
* e$ F! X, V4 r% J curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);
- L* B& U( n* r8 i$ G. }: R8 `
9 S6 h0 l! ?, j. j$ a section1.AllowSelfIntersection(true);) `+ W6 n/ J; B# q
% s8 I! |4 P1 {2 s) z
SelectionIntentRule[] rules1 = new SelectionIntentRule[1];
% j+ Z' ? o8 I! v* E& c rules1[0] = curveFeatureChainRule1;
7 M* ^* R9 S9 i7 b NXObject nullNXObject = null;
. v H5 [- e a( X/ J' V2 t Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);# d* @( _2 r# {% ?# x- M
section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);0 P7 E9 R, o, @. M
我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
7 O3 V0 b h( [7 z改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;
. U1 [3 Q6 K, R6 {, y L它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;
1 j) i& v. Q, {4 _5 R# y W# _+ O% T$ r& c9 K/ O
再录一段没有草图的拉伸' q4 B9 B$ ]! Y5 H: Z! L0 ?, g# h
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
* \& s- e' t C9 ]4 I NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject2$ B& T" E' W% R; D+ }
features1[0] = offsetCurve1;2 A# ~8 y8 |& R2 {1 X; }9 \/ }
workPart.Features.SuppressFeatures(features1);/ ~5 z* @2 | O7 L: ~4 a( \) h
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;3 S1 [* B1 R5 h7 ^ Z
) |- X6 U& O7 @* k" I求高手告诉我下怎么转换
5 y& u! S7 J9 M/ J4 p9 b4 T |
|