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

[二次开发源码] NX二次开发源码分享: 如何获取装配导航器上PMI的节点名称

[复制链接]

2018-6-22 13:32:01 2370 0

admin 发表于 2018-6-22 13:32:01 |阅读模式

admin 楼主

2018-6-22 13:32:01

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

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

x

1 \3 K; r5 l  u; SNX二次开发源码分享: 如何获取装配导航器上PMI的节点名称2 y: q8 L  q( V0 _$ ^
% i$ ]+ }' a$ |# i7 ]0 H' M" a
NX 目前没有想过方法,需要借助 KF 函数
4 R! p% g* a3 I. @2 E( I8 o2 ^7 R" J3 @' h9 z# ]; X2 v
- p! l2 Z' n. F) w7 ]0 o5 W

6 L" W4 c" U7 `7 m& L' `// There is no direct way to get the name that is shown for the PMI object
5 e& E! v  V& r+ w    // in the Part Navigator.  See ER 7961161.
) B/ _5 @1 }/ ~3 f    // This method uses a Check-Mate function then parses the output to format it
* f6 E' j* u' M* f    // so that it maTChes what is shown there in most cases.) Q) N- ?# P7 M, \4 Z2 U, S5 S
    private static string get_pmi_part_navigator_name(NXOpen.Annotations.Pmi thePmi)
8 t. q; F' H$ c% r4 g9 h    {
. m; }' M$ n0 y# |1 c. k4 L        string ruleName;
* `7 ]' k4 s" c4 a        theUFSession.Cfi.GetUniqueFilename(out ruleName);
  ^$ o' F" |+ s+ G: N0 @: V- p        workPart.RuleManager.CreateDynamicRule("root:", ruleName,
2 f7 T" A7 ^  C9 k  o& _) j1 j$ c1 g. y% F            "Any", "mqc_askPMIObjectsInformation({" + thePmi.Tag + "});", "");
+ z3 ~8 n% c8 d9 h% y7 R        string theValue = workPart.RuleManager.EvaluateAnyAsString(ruleName + ":");
" y2 V1 v- u1 G! i* A        workPart.RuleManager.DeleteDynamicRule("root:", ruleName);; C  V* x5 F0 J! f  j& a

+ y1 y5 D/ F; S& {- v/ G# x

# E, ]% t, d% D+ K        string[] infos = theValue.Split(new Char[]{','});" V6 z8 i* {& \" s0 J
- `& S! M  \3 y9 }1 w7 |8 h
3 S( |" z' m5 \3 q
        string theName = (infos[1].Trim().Trim(new Char[]{'"'}) +
! Q, i# U, ~/ X0 P            "(" + infos[2].Trim() + ")").Replace("PMI ", "");* @6 I4 `+ W# A" s. K$ @: e
        return theName;* G; s! |8 R0 a8 _1 v
    }. V% B& v, T9 p  f( I/ Q
* V# s# \$ ?+ @+ H2 K$ m2 Y
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了