|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
0 Y h9 Y" j: o1 C5 z/ p1 l' C' e2 i2 {, r0 f& ^
NX二次开发源码分享:报告当前Teamcenter是两层还是四层
& S4 _9 h- }# d( N3 T$ O7 K7 a- static void do_it(void)- M) k$ a' V( i0 x' L
- {/ _ A1 b: w8 J) s% J3 i
- logical IsManagedSession = FALSE;
: O* ?, ^# y, J2 {, A - % U' v' M) q2 |; g" ~7 _, B& o
- UF_is_UGmanager_active(&IsManagedSession);
! ~+ Y1 Y- Y1 G+ z
) r- b& h$ [' ~, _- if(IsManagedSession == FALSE) return;
|4 R7 \* `) X- E+ l4 ]6 Q
# T7 J6 ^) M, H3 E- k$ f- Session *theSession = Session::GetSession();
/ A. i+ W0 }# N- ^& ]% F: [ - ListingWindow* lw;
( {) F! _8 I. a - lw = theSession->ListingWindow();& K- Y4 D, h3 B7 C
- 5 t4 E: J! {# h% P( y" h& D
- NXString connectString;
; a# H, c6 E r" N0 W- K3 G7 U - NXString discriminator;
% v7 S) w' A* `+ B -
& j% G# x* A1 s- @- \) [8 S- W - theSession->PdmSession()->GetTCserverSettings(&connectString,
, K" P- S2 a8 a: s/ P% F# u - &discriminator);
& q& b0 \; q8 m' h& G" L9 ^ -
+ s0 Q, b: I+ x) h3 W - lw->Open();
4 S$ r8 r, P5 v A3 Z" F" D, O' N6 ~' k -
) M6 p8 F) d5 w0 G$ F# |* i5 Y+ `$ { - /********************* uncomment to see the string values. {9 K T& `( Z# F. |
- 1 [5 x3 I5 W9 w7 J+ A
- lw->WriteLine("connectString: ");$ `& e1 {$ j. W$ {5 ~$ Z
- lw->WriteLine(connectString);' M4 ^' f% j# S7 u5 l0 m
-
- \$ X9 L" O7 ?) X2 @# a* a& y - lw->WriteLine("discriminator: ");( j9 c+ p/ _' l; p5 U* v3 A" e* C6 n
- lw->WriteLine(discriminator);! O1 S; n2 h" d
, \0 a* I" E0 B, O- lw->WriteLine("Note: Empty string indicates 2-tier");
4 S2 V) L' e( L: [. G' S9 M - *************************************************************/1 e! i6 |" c) n
- ; A4 i/ \( o- t, a7 N5 O$ x% i
- const char * discriminatorString = discriminator.GetText();4 i. o6 o) R) J" q( S
* z$ h/ q% @+ t2 C2 F e0 z- size_t sl = strlen(discriminatorString);1 A- @0 |& F3 w) |
8 X- V: }: K H; L+ K" d- if((int)sl < 2); z* b3 J4 ?2 k! I
- {
/ d; T* H! F5 M3 g! } - lw->WriteLine("This is a 2-tier session.");
# `, \7 d' L& G& { - }
) l& c1 j& Z P; d - else2 y8 z7 U3 z9 f" p: A
- {
" e( ~' X( L, n7 i r" B- d - lw->WriteLine("This is a 4-tier session.");) L8 ]; s6 n O8 K& }- p# m
- }
4 a( h$ {; f- ?: u/ @5 Z - 2 _9 \: d4 {1 k' I% W/ @
- }
! W) ]/ H% N3 h7 l d
复制代码
4 i3 S: K. }) X$ F# x- B% U+ R p$ S' I9 `$ J+ ~6 l
# @/ T6 ~" ^# C Y0 R
|
|