|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
! m7 I3 i E4 N3 K( B7 c7 o
0 `* g, P& J. v, UNX二次开发源码分享:报告当前Teamcenter是两层还是四层- D) U- W$ z- g+ Y5 |" C. J8 M
- static void do_it(void)) x1 h0 l9 I( A, Y+ }* q% R
- {
+ t9 r) R' e* ] S* G - logical IsManagedSession = FALSE;8 {) k" K* k) h. _8 J* K
- $ p4 q* K6 Q% `
- UF_is_UGmanager_active(&IsManagedSession);" o5 T/ _6 U" j; L2 R5 O
0 K* i# L# T$ ]- if(IsManagedSession == FALSE) return;0 ~; {" E6 [- \" X$ z! n* }9 F
2 l* L" p. R5 s7 L- Session *theSession = Session::GetSession();
( y* m: S( h) R# [; H% F6 U - ListingWindow* lw;
" l% W7 X2 U! @; n- I - lw = theSession->ListingWindow();
% i! g* u1 s4 N0 Y& Y7 k" `! Z0 W& _ - 8 s( Z; ^+ Y' a( J+ i+ _
- NXString connectString;
; n5 u+ T. L4 O$ E - NXString discriminator;( @) u3 S; c" j3 z7 _$ u
- . \ d; R O- @( P& m
- theSession->PdmSession()->GetTCserverSettings(&connectString, & Y" \$ H$ r! L+ h( X
- &discriminator);6 ]5 n$ ]" r1 b0 b
-
i! A, s& F9 p- S$ z - lw->Open();
0 `0 b4 }8 p1 S* C4 R - ( I% I: ?# Q1 C; w" a
- /********************* uncomment to see the string values1 ~9 T2 a2 ? S3 P: E, L8 K
- 6 W. r9 r$ z" y5 G8 z# o7 ~
- lw->WriteLine("connectString: ");- c- h3 Q4 u# l
- lw->WriteLine(connectString);9 ]$ Y1 g6 z6 [. u- T- _) F" v
- ) W! J* L) q9 c- |) U+ S; L4 g
- lw->WriteLine("discriminator: ");4 i* M5 E" r" ?5 k
- lw->WriteLine(discriminator);
/ Z! P9 Z7 t% Q7 l! i4 n - . O' D* |' q& v" Y* I5 \
- lw->WriteLine("Note: Empty string indicates 2-tier");
a1 X2 e s; z- |5 F) P6 _" o! P - *************************************************************/
0 c# c7 j$ }7 R/ o
' a3 _& C% L( ]3 }, W- const char * discriminatorString = discriminator.GetText();
( p" I4 \- s+ a2 o8 Z- u - 2 A( ~* |/ _0 u# Q/ q: o
- size_t sl = strlen(discriminatorString);
; ]' p* Q5 ~/ Y6 i$ Y: a3 Y1 R# R - 0 i$ N c0 ]- k6 }
- if((int)sl < 2)
9 `2 s& j9 q- W$ n; F - {
: K' @8 q5 j5 Q - lw->WriteLine("This is a 2-tier session.");
; i! @- [' S1 C& ~3 {5 v% Y; b - }
- L6 ]; x) n1 J' W& t) k" \ - else
6 B! S; {5 h7 ~( V6 [ - {
! ~- p2 M; W `! o& X0 u! s - lw->WriteLine("This is a 4-tier session.");
$ h8 _$ `: d3 Q# q- [$ ^/ o ? - }
/ e- Y6 L3 T/ l9 v+ D -
+ C# P- k& I8 M3 W2 Y3 ] - }2 {& M0 ^7 z5 d2 T
复制代码 + r e+ h) P$ i, K7 @
: U. J( B5 C6 O4 w% L" V" d* i3 v6 r
|
|