|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
5 w9 f: r' }; u% N
, Y4 c, F, P8 P3 @1 h
NX二次开发源码分享:报告当前Teamcenter是两层还是四层. ^/ v3 Y' o* y/ [; s
- static void do_it(void)6 C3 S% S$ E' V/ z1 V: Z# h1 `
- {3 f ]+ y. v" b# V8 ^' p
- logical IsManagedSession = FALSE;' J S7 i0 ?$ l: N( }
-
6 z% E8 O) |# t( k. e - UF_is_UGmanager_active(&IsManagedSession); ~+ ]( k0 y/ i; _! q
- 7 q+ |4 r) a% F7 k& g9 R; U6 i
- if(IsManagedSession == FALSE) return;1 H- t3 w9 U% f) B2 G$ A/ V
- $ ^8 V) @+ \- v3 {5 u
- Session *theSession = Session::GetSession();
" K+ _ \: W7 t" _. h - ListingWindow* lw;
( w4 m: ]; T1 t5 g - lw = theSession->ListingWindow();# y" E7 b c6 s. R6 s
2 h7 K1 q5 h- \3 d- NXString connectString;( V1 \/ y( C. k! \
- NXString discriminator;
' j% T5 ] \3 a5 K -
4 b- W& z1 K) d5 a; V, D - theSession->PdmSession()->GetTCserverSettings(&connectString,
W. G8 ^6 U6 M. a) Z A* ~ - &discriminator);
" L& S/ q- M& L, {9 b3 p -
+ S( z2 f, p6 \& Q+ ]9 Z- F - lw->Open();9 T# k# a, J. f% x9 B; U* ?
- ) o p: i( W: s
- /********************* uncomment to see the string values6 C7 n) B! a8 B8 ^- [* N
, X: h; T+ m0 |8 J/ D2 c# ~- lw->WriteLine("connectString: ");
* Z7 d3 I& a1 F% h/ H6 ^ - lw->WriteLine(connectString);) `, N; i) S/ S; W6 _: b) Q% O
-
8 z) {5 _' |; i1 H. }# c9 {9 N8 |0 _% X - lw->WriteLine("discriminator: ");9 a5 v/ {& F& {# m3 X( |/ \
- lw->WriteLine(discriminator);
% I, z& F" J' C+ s: Y% M5 | - 0 j' Z9 S. G& H) Y+ D
- lw->WriteLine("Note: Empty string indicates 2-tier");: ?4 f& Q5 f+ y* a/ u
- *************************************************************/0 A3 P* I5 B: b# E
0 s3 d8 i9 Y& n, q1 w% A& u- const char * discriminatorString = discriminator.GetText();
, D5 E- {# {7 ?6 m5 f
: H" ~+ @2 G! V- |3 j! @3 j- size_t sl = strlen(discriminatorString);. T* `4 h" a" \& k1 f) e
2 }" j9 @( o* Q/ Z- if((int)sl < 2)
7 ~4 m4 i5 ?1 p9 u7 W: { - {) a4 G& t4 ^$ l5 I
- lw->WriteLine("This is a 2-tier session.");) {: q2 G8 ^$ V! S. s+ ]
- }
8 J. r& m |) n# M; ]% T - else
6 I" {( K; ^* H0 |) [ - {
4 f+ L8 B8 b& a4 a; b r; J& e - lw->WriteLine("This is a 4-tier session.");
4 D7 [( M8 v. e5 B* U - }
5 _: R% { ~2 h k7 j - 4 j% a8 S% D$ f' B6 _7 z
- }& B/ Y9 i$ c ]$ U5 r3 K% w. \+ D) w/ \
复制代码
5 ]1 `3 C- I& c. w2 Z1 J$ l8 y: x3 q3 r/ b
% h- ?! g. _1 y |
|