|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
UG NX二次开发源码分享:Teamcenter集成环境下,报告角色和组
) [: }3 ~) Q; {5 ~( x7 W* e通过NewDatabaseSessionOptions,可以获取teamcenter当前账号的组合角色!
; @/ |5 f& K% F1 E8 o这个类也可以实现设置组,角色,获取卷等操作!. O4 O V3 T5 Q1 _% T. B5 G& I
5 M. w4 u5 |$ {" e) m$ G* d & ^5 j+ ]7 P8 q# p- F y7 i. {1 u3 p
std::vector< NXString > GetGroups () , `# d0 s- ?; b. E- Y% u# I
Gets the names of the Teamcenter groups to which the user belongs. ! R- p& L1 ?" l; ?3 b/ q* K2 w
: n# A+ m2 c6 x6 C
. g$ {" C4 h, b: Hstd::vector< NXString > GetProjects ()
6 g* G$ ?& ]7 c5 z1 T Gets the names of the Teamcenter projects to which the user belongs also the first entry of the returned projects list is always empty.
: S& z7 X0 H- A7 k# ^0 [' s
# g) w2 s; Y& l z, y
# k# t& ~6 u3 U% x6 ?* ystd::vector< NXString > GetRoles () ( B O( @& u( M; ]/ p$ K3 k% K
Gets the names of the Teamcenter roles in which the user may act, given the current group returned by PDM::SessionSettings::Group .
) K- R/ O, N9 R, F, K
# N6 }0 `! `, l* I # G j( a2 H/ c" s
std::vector< NXString > GetVolumes () 8 t+ ~: H( J; D8 v# T
Gets the names of the Teamcenter volumes which the user may use, given the current group returned by PDM::SessionSettings::Group .
L/ t. ]( S7 u# |4 _7 B* }: a$ a2 q( j/ Q- G
6 s1 u! k/ f3 E6 N
6 ?( H) W! r1 Y* ]! Estatic void do_it(void)
6 z3 `- F, b: H5 H{
" O" y/ R9 K1 f3 ^! O Session *theSession = Session::GetSession();
0 R1 f7 P; x1 |! i& d Part *workPart(theSession->Parts()->Work());
R+ i4 W" O! x Part *displayPart(theSession->Parts()->Display());
# g, U/ }0 ~6 i3 W( o$ ]8 p 8 L9 K2 |: b/ n) U) w- Y/ V- U# T
PDM::SessionSettings *sessionSettings1;
, R9 Z. j) R& n% a+ L$ S$ M& P sessionSettings1 = theSession->NewDatabaseSessionOptions();
5 E# D5 q/ ?. I6 |" H
" X3 q7 }8 y- F/ o3 [/ l: d NXString CurrentGroup;5 V& s& K/ J( C+ U- N1 j
CurrentGroup = sessionSettings1->Group();* A' r5 G; _3 N/ y% z/ s& J: [
0 K$ Z0 G; N J$ N. Z' h2 ~% J2 F1 J NXString CurrentRole;
! d h9 ]: N6 A- w. c CurrentRole = sessionSettings1->Role();" Q: H/ i( m6 s4 f3 Q$ W# @
; V/ j i7 ^; b) e4 J, o2 c theSession->ListingWindow()->Open();6 }- e2 f/ E' z2 O2 j
) Y" o$ X3 w3 M w
theSession->ListingWindow()->WriteLine("Current Group: ");2 }$ d& P! [" \
theSession->ListingWindow()->WriteLine(CurrentGroup);2 ?+ ?0 N# k9 \/ _( r3 ^5 c, E
& ?3 s- Y. D7 y% X. G3 q/ m5 v6 M# y; `
theSession->ListingWindow()->WriteLine("Current Role: "); 3 }7 h4 T) x/ l J) a6 S
theSession->ListingWindow()->WriteLine(CurrentRole);
( `9 N4 F" m& S- [+ C. W) \! k: u" d/ y' \
}
) I; s6 z7 @/ d. m3 a# W, [6 v8 `2 p6 F8 M
" _4 T$ d2 e c6 @
1 E# ]8 R3 \# A- N( G
|
|