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

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

[复制链接]

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

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

smalfly11 楼主

2014-2-21 23:13:15

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

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

x
这是录的日志里草图偏置曲线里的" k* B$ I. J* i
NXObject nXObject2;
& C2 w1 ~: |: o, `    nXObject2 = skeTChOffsetBuilder1.Commit();
- E& d+ d: Z- ]) P8 r) z% R; Q   
5 e9 D& f; q' u9 [9 T/ R0 m' w    NXObject[] objects1;% c0 t3 [$ w* a% ?! }. ~* H8 d8 _0 f4 S
    objects1 = sketchOffsetBuilder1.GetCommittedObjects();5 j( J: p! X3 W
我返回了nXObject2; $ J+ G! S  @/ m: B$ B
并录制了一个草图拉伸的日志 里面这么写的. G$ \& k3 U; Q* T  F0 Q+ l
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];8 s7 K9 ^* G: D/ n' k$ B) @- y+ f( z
    NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");  Y7 Z$ y9 f( O5 R# m& O
    features1[0] = sketchFeature1;
/ t' r) _' q; n# @' q    Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");/ A1 m4 i6 Z- R; M
    Line line1 = (Line)sketch1.FindObject("Curve Line4");
& {* X4 x: A: i3 c4 y4 Y/ B    Curve nullCurve = null;
# q6 `7 U" [' Y" G$ J    CurveFeatureChainRule curveFeatureChainRule1;
8 c$ D. b/ a, I: x! z    curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);
# J& R  I' G. g4 a* |" [6 C   
& M; |# s4 P  T  j    section1.AllowSelfIntersection(true);
% f; r9 E; v4 B. t5 U( s    : v9 Q" M% s7 Z" o) c
    SelectionIntentRule[] rules1 = new SelectionIntentRule[1];2 g7 N, m9 i% o* G: |3 \5 Y
    rules1[0] = curveFeatureChainRule1;
5 }$ C8 p- b4 |* p& {: U$ B; V    NXObject nullNXObject = null;
+ ^5 x" }2 x1 Y1 j# L0 U, d3 p    Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);: p/ w7 C. `8 A8 T8 l
    section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);) T7 h( m7 A7 E3 [. T
我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
2 [' s$ u/ o2 X: E1 _改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;
- e7 {! R( O3 V( ^- r它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;, t, }! }0 w, X; b
( ~  R5 B) [4 j  k6 N; X
再录一段没有草图的拉伸  D' H% I8 A' l. y/ z
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
1 {8 V; Q. q7 l7 h0 `6 p4 E    NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject2, {; y1 J# v" A: p$ H* i
    features1[0] = offsetCurve1;2 g7 s) c+ u' j' U  R% c6 c
    workPart.Features.SuppressFeatures(features1);  U! Q* e9 d3 \8 I+ A' H
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;7 l9 v' O3 v5 B' g3 X  k, L& Z
" H. W' n1 D0 @4 I
求高手告诉我下怎么转换" \' L; r8 B- O# q& q
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了