|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
" C2 u& r$ G$ `' n; s' l" t8 g
6 z1 S0 I. ] t# MNX二次开发源码分享:报告当前Teamcenter是两层还是四层! d) t* c! ^0 S% ]+ a, Q* f+ K
- static void do_it(void)
2 ^' H6 w3 M0 M - {
1 ~7 J0 i( Y! n Z# X# y1 a' M - logical IsManagedSession = FALSE;# Z& H' g7 h3 D) n7 I9 |2 F* p
- C( q/ Z9 |+ n% {0 U6 g
- UF_is_UGmanager_active(&IsManagedSession);! ]$ L1 A( n( ^0 b% |, B
- " n* Q# h+ X* E) R
- if(IsManagedSession == FALSE) return;
1 E, q4 C+ g9 p- U
5 C6 B3 ]& V' [! |; E! _- n* ^% w- Session *theSession = Session::GetSession();
8 D8 Q% e" w# e3 S - ListingWindow* lw;
( a8 h5 }; C9 U# e1 a, z6 m - lw = theSession->ListingWindow();% V5 ]: Q3 s/ y: ]% a y5 l
" r0 g% _, t) M+ Y3 R- NXString connectString;
4 M, O9 j0 C/ _% h- f - NXString discriminator; o/ f+ M/ z z8 M3 d
- - I! a$ i# K1 H1 X
- theSession->PdmSession()->GetTCserverSettings(&connectString,
$ a8 [4 }+ u6 H& N. x - &discriminator);5 V. X. @9 c0 C' C# c: s8 r; r
-
8 \9 J+ ^0 C: l' U0 y! _0 [ - lw->Open();* v3 I' Y6 |3 s5 K. B: D
-
" z' t2 u. m N! Y - /********************* uncomment to see the string values- Y# p, b4 b/ v; _5 u9 A G& k: B
- , A9 s; m- c# Q' O* D
- lw->WriteLine("connectString: ");
+ P: A8 |% U) c9 \, v1 r6 V j2 P - lw->WriteLine(connectString);6 _& A6 s" ~% h: r: b" Q/ L
-
: P n0 n' r ?! M( K9 ^ - lw->WriteLine("discriminator: ");
2 ^7 ^# G. e- D* a% h - lw->WriteLine(discriminator);! @5 r1 b9 {5 E7 ]0 Z. o
" j2 K1 X F) M" X- lw->WriteLine("Note: Empty string indicates 2-tier");
k4 f) U1 ?4 f T& Q: ^ - *************************************************************/; g& N$ I @( n: j4 Y; R7 w! ~9 }
- 2 E0 z( C0 O5 x
- const char * discriminatorString = discriminator.GetText();
, C: D+ x4 P$ y3 U. ]
2 }4 W& K0 ^; z K2 [. U" d- size_t sl = strlen(discriminatorString);4 l4 D" M, R3 N o# H
+ g9 [: V; a. [5 V& K- if((int)sl < 2)
+ w! L3 k; f/ I9 ^; L - {
$ n/ L2 |. b7 q6 X. r$ ~- ^ - lw->WriteLine("This is a 2-tier session.");
x0 N' {3 l/ h+ Y) z# V+ d2 ^ x - }
8 c0 x' P6 k& q6 k5 u - else
% D7 a8 ^* v, n4 K9 P& }: i - {% z2 H- j8 f, }% o- y
- lw->WriteLine("This is a 4-tier session."); \6 p3 U! c6 J! y) Y
- }
" ?# @2 X% C0 e& \' o6 J" d5 a: H1 s - ) F" W/ R+ P$ Y9 R
- }
! J4 ^2 b7 a3 I& r) ^
复制代码 ]* E8 d( O& K1 F
3 B: A* H M! q$ Y
( ]; O8 h, Z$ d$ b, W- |2 t# w
|
|