|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
UG NX二次开发源码分享:Teamcenter集成环境下,报告角色和组8 x, e9 x; }+ H2 }1 P4 O7 w6 L
通过NewDatabaseSessionOptions,可以获取teamcenter当前账号的组合角色!
( f% o c {9 t这个类也可以实现设置组,角色,获取卷等操作!
2 U: X7 f2 O9 @9 b+ u, P! }5 g/ G% V) _3 I8 \! t( N" U
) z+ v- D5 A5 B1 r: u
std::vector< NXString > GetGroups () - ?- o: Q5 ?. t$ q9 y* U3 z0 k
Gets the names of the Teamcenter groups to which the user belongs. 7 Q! C" J- P3 Q4 i
: _9 C* y, V& W3 [" v# e O- }
2 w* x2 e2 [* }* M% [std::vector< NXString > GetProjects ()
+ K; L- s, {6 O/ D( L9 Y8 O Gets the names of the Teamcenter projects to which the user belongs also the first entry of the returned projects list is always empty. 4 d5 K( o/ z! E' J; Y$ [8 t5 R6 ?7 Q* i3 m
8 S. M* o% e; h7 {8 A
* s8 b$ K5 p }/ r/ c) J, E' `std::vector< NXString > GetRoles ()
* ~4 s+ J/ X; J, c2 K$ l- j Gets the names of the Teamcenter roles in which the user may act, given the current group returned by PDM::SessionSettings::Group .
0 d3 Z9 O4 d" M7 I/ K' ~5 o5 B
5 b3 g/ w7 {# G# n3 V& m
4 K5 p( M" A% Vstd::vector< NXString > GetVolumes () 0 Q) u0 O8 _* [
Gets the names of the Teamcenter volumes which the user may use, given the current group returned by PDM::SessionSettings::Group . $ L) h1 ^8 b( r
' J# F6 T4 W1 G9 L# `2 K" o
/ A* k- i& I; H6 d5 J9 o
8 B! N5 ^0 m: h/ R2 e+ g4 v1 sstatic void do_it(void)) y- A7 _; o- v' P& y4 @7 X
{
8 e2 J, n/ r8 t7 e# ~ Session *theSession = Session::GetSession();2 H/ ?$ P N) f0 ~
Part *workPart(theSession->Parts()->Work());
2 c& f1 x. }% N( E Part *displayPart(theSession->Parts()->Display());
5 {/ a' }$ `) H : G; e" p9 v P+ z
PDM::SessionSettings *sessionSettings1;* h) @) q$ v3 I, X- b8 @3 f: c
sessionSettings1 = theSession->NewDatabaseSessionOptions();
/ \* R9 n6 r3 c* j# Y. x : `! F' x( h' _$ B* I2 L6 o+ q
NXString CurrentGroup;
4 N- e. s. j4 F& ~- ?! ^5 } CurrentGroup = sessionSettings1->Group();
7 \* G# D7 I6 O4 G
+ w7 G( S% i4 X) I( S& J3 C% [ NXString CurrentRole;
6 l' B1 Q5 J6 }$ g8 k4 D% C* W CurrentRole = sessionSettings1->Role();
- G% S( C1 j# h5 r3 F( k" J/ g; H4 x' D- l" a3 _$ x4 H
theSession->ListingWindow()->Open();% y; ?$ u( L- ^+ ?
5 n, Z* K3 W) f/ W theSession->ListingWindow()->WriteLine("Current Group: ");4 K" N$ k8 `) V6 p8 F& @& i
theSession->ListingWindow()->WriteLine(CurrentGroup);
+ P% Z* k% B+ @- N [" p& N
# ]& Q; s! j& `! t( d theSession->ListingWindow()->WriteLine("Current Role: ");
+ r4 v/ o3 Q+ K: a theSession->ListingWindow()->WriteLine(CurrentRole);
/ T7 [" O4 @) z- Q) `3 d# V/ W
}
) G$ \# B* H* d' r& F; g5 p- o- g- O# E! f
3 n2 }, G8 H5 Z/ U `8 V( r. e+ U
|
|