PLM之家PLMHome-工业软件践行者

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

[复制链接]

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

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

smalfly11 楼主

2014-2-21 23:13:15

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

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

x
这是录的日志里草图偏置曲线里的8 `/ }3 k# o/ K5 V( E; h( `, U- E% s8 L
NXObject nXObject2;' h) R5 e4 X8 B, \) K0 W* Y
    nXObject2 = skeTChOffsetBuilder1.Commit();
. E: N; S& T! i; f6 i  o  x, _    ' m0 I9 L& W: R1 b$ r
    NXObject[] objects1;
3 [1 ]: c: j& e' h, A$ s+ @' ?    objects1 = sketchOffsetBuilder1.GetCommittedObjects();
, y0 E) F4 [8 E我返回了nXObject2; ' t* K" x5 ]" s- g
并录制了一个草图拉伸的日志 里面这么写的2 t1 L% p& G5 X7 y! }. F% T- h" {
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];0 l. e- C* k- C
    NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");1 k* e. g. P! c2 S
    features1[0] = sketchFeature1;" G$ N8 [2 c. W- ?/ q
    Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");
) Y" h# g8 s- y1 \1 a    Line line1 = (Line)sketch1.FindObject("Curve Line4");. K" b' w: O8 Y( J/ b
    Curve nullCurve = null;. U" ]. A4 _) _( U, ]
    CurveFeatureChainRule curveFeatureChainRule1;, R7 c8 e! r- F
    curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);6 r; U- Y, T$ r, v
    # M+ y9 Q! p% P2 \  a
    section1.AllowSelfIntersection(true);
  K7 ?" }6 V! p0 _   
7 g4 Z' _  G$ b7 F7 N/ M* f    SelectionIntentRule[] rules1 = new SelectionIntentRule[1];$ D3 R  k" h, W! ?
    rules1[0] = curveFeatureChainRule1;% U" i; O% ]2 g9 H
    NXObject nullNXObject = null;, i* i. O% @% g3 r$ A
    Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);; O+ P$ Z, x6 D0 }% A* H  j; R
    section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);
2 |8 O+ q7 H3 D# ?我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");* c2 z8 M0 ^5 m& G
改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;
( d$ S" Q9 t4 X0 |: ?! K它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;
" b2 M% `) ]2 z6 r/ _% P8 ?0 B* z+ b/ j
' _. T9 ~+ h; @/ o* W5 v# v: j: J  U+ v再录一段没有草图的拉伸) l) ]2 Y- X+ U( ]; ?! p) @
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];/ @) L' m) j4 H
    NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject2
$ R* k+ M6 E& y    features1[0] = offsetCurve1;. N/ j$ c- n9 F0 i5 Y
    workPart.Features.SuppressFeatures(features1);
6 F- t# {+ ]) y9 B它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;5 {# n9 R9 n7 S7 X; H% W

* x6 |) y8 ?; m+ P+ G求高手告诉我下怎么转换4 I: H6 G# a# k/ ]
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了