|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
4 ^! E B5 g3 K4 }6 \) }! [, dNX二次开发源码分享: 如何获取装配导航器上PMI的节点名称( z3 ~: w1 [* o) J4 v. G$ x
; A- B. T6 o6 b: V& d. q/ oNX 目前没有想过方法,需要借助 KF 函数
B8 a. o( Y8 p+ R& L) A
9 t/ h7 S. S! D1 I! |9 s: n: F2 ]) Q* [. T. j
n% q Z5 A& b8 k/ P: c! z// There is no direct way to get the name that is shown for the PMI object" r5 n1 M5 z0 l* g& k
// in the Part Navigator. See ER 7961161.
: L+ {3 l. q1 C6 A // This method uses a Check-Mate function then parses the output to format it8 L9 U1 y0 N/ g3 Z
// so that it maTChes what is shown there in most cases.
3 m$ p& j9 T7 G6 V/ O private static string get_pmi_part_navigator_name(NXOpen.Annotations.Pmi thePmi)& P; d0 U" t P6 @; U
{
* e. x9 f' `* `9 D string ruleName;
; m/ h, E Q9 ]* {0 E theUFSession.Cfi.GetUniqueFilename(out ruleName);5 W, e- t; ^8 b# l+ S, m4 B" C0 N
workPart.RuleManager.CreateDynamicRule("root:", ruleName,* C& P- a/ d* [0 Z% P
"Any", "mqc_askPMIObjectsInformation({" + thePmi.Tag + "});", "");
- D4 T) e- K- m4 D* \4 p& p string theValue = workPart.RuleManager.EvaluateAnyAsString(ruleName + ":");% P, S& _9 z" O' B2 C/ O
workPart.RuleManager.DeleteDynamicRule("root:", ruleName);1 q+ Y# R3 V8 A; [
/ i8 L' B% ?/ ]2 N, Z
- i5 \" K) y" p P) l) _ string[] infos = theValue.Split(new Char[]{','});
( M( \: B" ?/ C( T
" p' k- b: x; R- Q$ G# Q( c
0 y7 j- N1 M- e string theName = (infos[1].Trim().Trim(new Char[]{'"'}) +
; F0 X$ I2 u/ H, l* P- M "(" + infos[2].Trim() + ")").Replace("PMI ", "");' w9 s* v% l+ @% w$ @% s, }
return theName;
: g+ x2 m6 q. }- s0 Q }
3 h+ d- B# l& o. R+ G5 n1 F2 E( F6 m
|
|