PLM之家PLMHome-国产软件践行者

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

[复制链接]

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

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

smalfly11 楼主

2014-2-21 23:13:15

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

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

x
这是录的日志里草图偏置曲线里的* }$ ]2 m* @6 t* _! C: C
NXObject nXObject2;
/ V. ~. t- o3 X* n& f# Z    nXObject2 = skeTChOffsetBuilder1.Commit();+ o( x2 H0 F$ ^+ M* W
    & j: y& y: r5 p5 [, ~& B% ^
    NXObject[] objects1;
% F, |4 o# O4 n) h8 c9 w    objects1 = sketchOffsetBuilder1.GetCommittedObjects();' `/ q5 C# w# Y- O
我返回了nXObject2;
: |7 c2 ~5 E3 M8 d" ~! Y5 J8 g并录制了一个草图拉伸的日志 里面这么写的! T5 {  b0 \/ h7 V
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
; }0 k# O0 u# \' \    NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
. {! X$ a1 w# S    features1[0] = sketchFeature1;
/ ], O0 M3 G$ H9 m    Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");* f, W$ W; |+ }, e4 C* K6 ^
    Line line1 = (Line)sketch1.FindObject("Curve Line4");
. A  t$ U6 I1 i, r( W( R0 F    Curve nullCurve = null;5 G4 t4 g% _( N
    CurveFeatureChainRule curveFeatureChainRule1;
# U9 D% o3 {% f' L9 X    curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);$ B* U, }$ o6 @& O
   
  z8 l' C* r) A, f" F    section1.AllowSelfIntersection(true);
0 h  A$ m: w# \   
$ Z8 o# x# b" c9 s- ^0 C# \$ b! _    SelectionIntentRule[] rules1 = new SelectionIntentRule[1];* T( Y$ |0 y& e: t3 v
    rules1[0] = curveFeatureChainRule1;
. y- W+ J5 O' c3 w) z% J  s    NXObject nullNXObject = null;
/ {& t) I! L: F. @  J    Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);
. K2 L- {/ h7 S, ?" b, x    section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);
( }' p- l$ L5 W! {8 G& p我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");& l! `7 G, y  Z
改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;1 q; N4 J9 F* l5 n% U4 X
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;1 D9 z) S0 l7 |
0 i* s# a7 \; Z. u0 P& j+ [0 c
再录一段没有草图的拉伸" D" x& s/ v/ v, `3 w
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
) P! `  a5 A- @! N- d& {    NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject2
$ C3 M3 Z+ J/ ^4 @$ @7 p    features1[0] = offsetCurve1;/ l+ v! J2 U+ M5 ?0 t" z" f
    workPart.Features.SuppressFeatures(features1);  b! X+ U: k0 J6 \8 l8 X" K
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;
( z, R, x" H7 f; E0 O
' h& B( H- T4 a4 T/ y, Q3 s. u. r# O求高手告诉我下怎么转换
: d( p4 |) N* b
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了