|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- u+ o( ?# i- U" K) L K1 }, GNX二次开发源码分享: 如何获取装配导航器上PMI的节点名称
/ N) r. L$ v1 I
- o+ ?* o+ S. n+ \+ tNX 目前没有想过方法,需要借助 KF 函数
3 G& h% \: o; O# J; D8 U$ ?, k0 w9 l t( D, \; Y( q4 A/ i
, y" I" f/ ^; ~8 Q
; `, a. g d' y9 A% m9 l// There is no direct way to get the name that is shown for the PMI object
$ ~" p/ ?9 t8 ~7 M& { // in the Part Navigator. See ER 7961161.
: d$ J k y8 h // This method uses a Check-Mate function then parses the output to format it8 v, I" I7 ]% l. C& P/ g' R
// so that it maTChes what is shown there in most cases.
0 ~& X: @' W1 ?& Y" | private static string get_pmi_part_navigator_name(NXOpen.Annotations.Pmi thePmi)
8 K1 y/ j7 k5 n$ u {: n, w& ^$ J; {6 `& p* U2 W+ l
string ruleName;$ o( r5 c k: Y( T5 \/ k
theUFSession.Cfi.GetUniqueFilename(out ruleName);
! m1 } v! o" D1 b workPart.RuleManager.CreateDynamicRule("root:", ruleName,% n1 Z( A7 }6 y! F
"Any", "mqc_askPMIObjectsInformation({" + thePmi.Tag + "});", "");
* j6 b$ g( ?% q string theValue = workPart.RuleManager.EvaluateAnyAsString(ruleName + ":");
; g! t/ c0 V8 y3 Q* H5 G1 k workPart.RuleManager.DeleteDynamicRule("root:", ruleName);
# O( v/ m5 F, Y: o( X( U/ [+ D% l; [- c! I+ G4 o
' w( b. q- K2 ? E) `% B5 Q( q" p
string[] infos = theValue.Split(new Char[]{','});
/ m3 w* |" D" P: M/ T
3 p/ J& L$ U1 A' Y
. c6 Y# g9 V9 P- K: ` K string theName = (infos[1].Trim().Trim(new Char[]{'"'}) +& W) O& R! N# Q) |8 F' O
"(" + infos[2].Trim() + ")").Replace("PMI ", "");& H7 ]: V' j- I2 s
return theName;$ t' ^+ V& w' l7 t; ~) ]
}
! P0 ]( y# G) j
7 T$ ?0 p3 P9 P% g+ } |
|