|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
6 [- A2 P0 r: v; w) M, n% S3 b) \9 S" H3 ^
NX二次开发源码分享:报告当前Teamcenter是两层还是四层
5 c2 R) {& P, {- static void do_it(void)
3 C( t. ^, {0 c' Z* \0 L" v - {+ |2 {6 |5 t, `1 G$ ^& i" h
- logical IsManagedSession = FALSE;
, ^" c" z# f' X -
% p# u& ]2 u% x1 j" k1 T8 ^ - UF_is_UGmanager_active(&IsManagedSession);$ Z3 D" s' b+ U/ G4 v9 F, N
+ |! R1 }7 c& w% D" M* w- if(IsManagedSession == FALSE) return;5 v. ~; E3 r! W1 X2 U9 U* G# h4 {
& r& r7 }* Q$ j' e( B ?- Session *theSession = Session::GetSession();
: ]8 F- T: l+ p- X2 K2 R - ListingWindow* lw;+ T. `0 i8 i) T/ G9 j- V
- lw = theSession->ListingWindow();; m) U4 P5 n: }) }; y
- + D8 z- i8 ]" X
- NXString connectString;
0 W; C- s$ L9 l# f. l3 U - NXString discriminator;2 f- D; T C' S% f" s/ a6 e* a
- , O+ }" b" G& M
- theSession->PdmSession()->GetTCserverSettings(&connectString,
3 l- y. _- T9 h1 n# h - &discriminator);$ e( k6 r" I2 |6 [( x6 v9 @$ Q
- 2 N6 i9 Z& G5 {7 \9 c: m3 A
- lw->Open();) q# F. @/ w0 g4 D4 U
- - ^0 Z( P& i$ @0 K* t5 u1 D# \
- /********************* uncomment to see the string values
% g7 W! x; U; A - / j6 R3 | ]7 r! P9 G7 |+ k
- lw->WriteLine("connectString: ");9 S% j& ~' i8 N5 ]3 i
- lw->WriteLine(connectString);* K2 Q% U& L+ P
-
1 f8 a/ @; H" \0 @ - lw->WriteLine("discriminator: ");
$ h& s/ t% H+ c3 V9 W J' b$ ` - lw->WriteLine(discriminator);
. s% j" y, J% f7 \) t( j9 t - " F5 S$ F- X, M: ~* [; h) U, M
- lw->WriteLine("Note: Empty string indicates 2-tier");- f) e3 } H; L! Z3 h8 O' D
- *************************************************************/* N% x; @4 {: _0 E8 j
$ c. T" L) }& K H3 D: r0 l9 ~- const char * discriminatorString = discriminator.GetText();
9 t+ x+ u: V/ E, n( T5 n) b
* c F; e5 U2 k- size_t sl = strlen(discriminatorString);
' q8 w' R; Q" Q; P) _# U! U4 Q - , C S7 D( x8 I5 y- b7 y
- if((int)sl < 2)
. _; P0 Q2 m9 s# g) Q, ~' R - {+ B& X @# F6 l+ X! w
- lw->WriteLine("This is a 2-tier session.");
; c8 _9 v; d% h6 A. U; U4 Z9 G - }
0 B6 K, o/ ]! b* D0 n - else& w9 k% M, b2 B& k4 j; q6 d6 S
- {
5 }" U, H6 V( ^ - lw->WriteLine("This is a 4-tier session.");9 ^9 a0 B( V" T$ B# [ w
- }
7 g3 E! W: U' | - 8 @, H1 r7 Q0 d( D/ `6 X, V; l
- }+ p; o6 P% J! [8 v2 _0 N: F
复制代码 : q& \4 |) D# A: R N8 _7 Y
( ~0 R' g) f: ?$ K% H; D9 ~6 E! L
|
|