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

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

[复制链接]

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

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

smalfly11 楼主

2014-2-21 23:13:15

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

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

x
这是录的日志里草图偏置曲线里的
" Q3 J6 }9 {8 R/ gNXObject nXObject2;, e. v  s; Z+ ^
    nXObject2 = skeTChOffsetBuilder1.Commit();
2 C8 T3 C; ]* c6 q   
2 v( |8 C& [: k( u/ b5 z" a    NXObject[] objects1;
. d1 h) a% f0 f$ L9 a# z2 _    objects1 = sketchOffsetBuilder1.GetCommittedObjects();2 z; F+ [& x7 f1 M. f* g
我返回了nXObject2;
# `3 w) `. M, Q; o6 ]4 x并录制了一个草图拉伸的日志 里面这么写的+ }& E5 I$ T; O: K) D: x& C
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];) u1 Z2 T& f3 U% m$ L9 {
    NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
$ m7 W$ \  T3 _1 H8 r( v    features1[0] = sketchFeature1;
: ]: J: e% U2 q' ~3 _  w- O    Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");
! G( R* h: ^; t* r& \; b    Line line1 = (Line)sketch1.FindObject("Curve Line4");
  P8 b3 s' q& h' T# O% _' Y1 O    Curve nullCurve = null;' y0 F- j; L% E* [4 h7 U
    CurveFeatureChainRule curveFeatureChainRule1;0 S2 n! b9 l$ s7 {, A
    curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);8 L2 A7 K. M3 M7 t3 h
   
9 m, I% G! ^9 e" x. b! A9 r    section1.AllowSelfIntersection(true);
$ g+ e' b. x( j1 ~8 Q   
: n) Q, [9 r. F: w% h    SelectionIntentRule[] rules1 = new SelectionIntentRule[1];
. T9 J* a7 h2 o6 a# [% F( x    rules1[0] = curveFeatureChainRule1;" d5 n* K3 ]- L5 w* W6 M& t& g
    NXObject nullNXObject = null;
1 S( B1 ]2 {* m) G8 g( ~    Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);
$ `' |4 e8 k  h8 [! _2 a0 N    section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);
6 n5 Z* C) Q, E" C我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
( X0 Y" B3 o& R( k改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;1 w: ~5 h$ w' N* |' m) t- v5 c- w
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;
( r# N  p, u# D
/ x- ?- I& G! u( K, p: |) s7 V再录一段没有草图的拉伸
( x; i' j) N) }3 j1 b7 ` NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];  l# \/ T% t! g
    NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject2
" b* ?5 F, x; j4 I: d) v" o* s    features1[0] = offsetCurve1;. w3 v/ @! l! g
    workPart.Features.SuppressFeatures(features1);
$ ^: k- Q% o  L3 x# \它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;
) M9 g$ R( R3 Z" A
; z  y% D. G4 ^3 D1 a( z求高手告诉我下怎么转换
2 k6 R7 W% D0 J" W. Y6 ^
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了