PLM之家PLMHome-工业软件与AI结合践行者

[求助] 草图偏置曲线返回的OBJECT无法用日志拉升

[复制链接]

2014-2-21 23:13:15 3416 0

smalfly11 发表于 2014-2-21 23:13:15 |阅读模式

smalfly11 楼主

2014-2-21 23:13:15

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

x
这是录的日志里草图偏置曲线里的- y2 K& i% e0 p. j5 M( W7 ~+ q7 l. Z
NXObject nXObject2;
6 ^1 K3 z) A6 h, Z4 p    nXObject2 = skeTChOffsetBuilder1.Commit();  ~: n3 w$ D" U) i
   
4 L- L' u3 _9 H    NXObject[] objects1;
2 b" I' Y& u( y    objects1 = sketchOffsetBuilder1.GetCommittedObjects();, |( H. p0 n3 N. P
我返回了nXObject2;
" m" T4 t" O- w并录制了一个草图拉伸的日志 里面这么写的0 n; |' V: R, q* G% l/ Q3 O
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
, p5 G' Z' H/ x0 f) k; m1 d* ?    NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
' V1 P6 ~2 D7 e$ I7 L    features1[0] = sketchFeature1;# }. ~$ A/ x7 s0 @( D
    Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");" _: G6 \2 v2 n' A9 `* x$ ?
    Line line1 = (Line)sketch1.FindObject("Curve Line4");
6 a, p+ y, f1 O3 w3 N0 Q    Curve nullCurve = null;
! k" q3 E7 [7 a3 H    CurveFeatureChainRule curveFeatureChainRule1;
! i9 D5 g( N  o7 w! y6 _$ B) C    curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);
3 S7 i) |* G, A* [( u* e    , }5 i1 P% w2 w# U. u3 `" r
    section1.AllowSelfIntersection(true);
. l  q, z5 C4 m  W- |2 H& C    , t! u9 t$ Y# _! Z
    SelectionIntentRule[] rules1 = new SelectionIntentRule[1];! v& v  a! R; q
    rules1[0] = curveFeatureChainRule1;$ O4 u$ C1 T4 N" p+ t8 L
    NXObject nullNXObject = null;
# M1 T1 C8 J8 J+ z2 M    Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);4 O) ^( t+ J0 H" f4 ~
    section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);
7 J# _$ V+ K: ]2 \: a8 v7 D9 x我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
* {" y9 n/ ]+ f改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;! M+ E' b5 C3 D
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;
* U7 ^0 ~! B2 l$ G! e0 `- y* ^
  f% p& u" Z( r: @* [2 l再录一段没有草图的拉伸" c- y  c, ^$ f* g, w' L% Z
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];  R3 s9 [+ u' y
    NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject2
+ b( n7 f( @7 w; {& S- L    features1[0] = offsetCurve1;
% K. K& M+ |+ H    workPart.Features.SuppressFeatures(features1);3 B' L+ k6 U7 j+ i' M
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;0 I* _  j2 W' A

* P9 u$ m5 A& J求高手告诉我下怎么转换6 N' s! `7 F) Y% K  U' w, G5 {
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.diantuankj.com/ doTeam.tech
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 注册

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了