|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
9 @" c5 ?/ Q8 |" s7 J$ p |
* j' k! [ g- f+ p4 P$ q; eNX二次开发源码分享:报告当前Teamcenter是两层还是四层" F' @! l% V& y
- static void do_it(void) v9 L! p" ^6 o) y' _5 J
- {" x" [5 q) q/ ~* ~ j8 }0 s \! T
- logical IsManagedSession = FALSE;
q7 I: T) v% f9 B9 b$ f -
1 p) z) z" g1 ~! w: f - UF_is_UGmanager_active(&IsManagedSession);
" G# _$ [& C7 r- n9 s6 h2 Z$ Z+ [& R - 6 E3 z! B" }* a2 \' t
- if(IsManagedSession == FALSE) return;
e* L" r/ j' ?! J I
/ V8 {& S8 K$ {& C R# k! F( a4 m- Session *theSession = Session::GetSession();: |: Y2 }5 i' a: O4 N
- ListingWindow* lw;
9 N" T5 t" T6 q( u; u - lw = theSession->ListingWindow();
% f2 b3 a7 u' N - 4 C t1 p9 w3 o7 c' ~
- NXString connectString;
( g/ c7 Q5 A+ |8 I( @1 w/ C7 \& K - NXString discriminator;
6 l3 ?+ l) l; y* N! g' z - * V0 [% G* H4 N1 Y0 v8 m6 J
- theSession->PdmSession()->GetTCserverSettings(&connectString,
& u; e2 L O& Z3 k/ L - &discriminator);
; D0 c) z3 D N7 f' p" N* `" C# j -
3 x( ^/ `8 |/ _; N+ {% x- I- D3 M - lw->Open();! o0 v9 J! f) I% C
- 3 J9 a$ m2 i& {
- /********************* uncomment to see the string values
1 t4 w+ c6 Q/ |; `' ~/ u( y
5 b9 V. @: Z- R+ @( i( F- lw->WriteLine("connectString: ");
' R8 N& o2 y* f5 \$ I" A$ Z; T - lw->WriteLine(connectString);' w2 T$ j6 ?( q1 j5 W- Z" ?
- : ~& c3 }0 A$ p( G' e, Y
- lw->WriteLine("discriminator: "); {: E7 Z/ a' ]" N a
- lw->WriteLine(discriminator);
# B- n5 C6 F1 G' B - $ i! D, X/ G1 M- i o) a4 q" C
- lw->WriteLine("Note: Empty string indicates 2-tier");
, o! J% H1 N* C+ i8 {7 K% I& o - *************************************************************/
( `6 A$ [5 _2 z! [6 A& v - : j; x$ z1 i5 `/ ?1 m8 g1 g6 J
- const char * discriminatorString = discriminator.GetText();
! @# y& K3 \9 e
% a% B" H% A: V4 ^/ L+ q/ F; L- size_t sl = strlen(discriminatorString);; `! i( p; o6 w3 O) `- v
4 c( z) _9 G3 \8 z- if((int)sl < 2)( h$ G+ B0 W) n @3 N! ]# r
- {
/ v) D# E4 T C0 Y - lw->WriteLine("This is a 2-tier session.");( W, O! B+ t. B4 \1 k' j, Z
- }! l7 o2 G( ?; x" u: I
- else
6 P5 \- {8 m$ `, F+ i - {
3 m! s- a, \) z: r: F1 s3 N" ]& g - lw->WriteLine("This is a 4-tier session.");
' D0 }9 |) d( q" n, P+ `& s7 P - } h7 }3 }. M2 T% V' x
-
: y* D& n; H. C6 C8 b5 t3 t - }/ Q$ e/ Z8 l: U4 P
复制代码 6 y) b% Y f1 d
: l8 K C# T5 j x8 ]; M6 `
5 U# D3 E/ W; I. L9 ]( `; b |
|