PLM之家PLMHome-工业软件践行者

[二次开发源码] UG NX二次开发源码分享:Teamcenter集成环境下,报告角色和组

[复制链接]

2014-9-27 21:10:30 3525 0

mildcat 发表于 2014-9-27 21:10:30 |阅读模式

mildcat 楼主

2014-9-27 21:10:30

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

x
UG NX二次开发源码分享:Teamcenter集成环境下,报告角色和组
. }! h7 }& b3 x( q' G7 l0 M( P通过NewDatabaseSessionOptions,可以获取teamcenter当前账号的组合角色!
- I  O* I) x0 E, D8 W! Q( h/ f/ ~这个类也可以实现设置组,角色,获取卷等操作!
: u( i, j% A; ]! q4 e. q9 w: l0 `

5 j+ M3 w2 |0 o* qstd::vector< NXString >  GetGroups () ; B) g7 V# ?7 S: Q
  Gets the names of the Teamcenter groups to which the user belongs.
' J& D( ]8 s7 P; X3 B ( j1 W9 ?. |. s4 U  E4 X* o
  ) a) C. e2 ]8 w- M# w; ~
std::vector< NXString >  GetProjects () " U3 x# |' V6 F! U: w; h  J; v
  Gets the names of the Teamcenter projects to which the user belongs also the first entry of the returned projects list is always empty.
6 X" ~4 Z, s; n4 r
  v) g. [9 Q8 G/ j! t) {% ^  
3 c$ B! q" I  c# O. o- d/ j7 Astd::vector< NXString >  GetRoles ()
( S! \- Z) Y- w# C) X1 E$ n# y  Gets the names of the Teamcenter roles in which the user may act, given the current group returned by PDM::SessionSettings::Group .
( b1 p. X' a! U. f2 n 1 C9 k$ ?9 O4 j6 \; u
  3 T& `) {- }6 T" W
std::vector< NXString >  GetVolumes () " H* Y% e5 W1 g( W. _) z
  Gets the names of the Teamcenter volumes which the user may use, given the current group returned by PDM::SessionSettings::Group .  
( a5 }5 [# h* l9 z! c
* N, ]$ [2 d* ]/ q' Q

+ }+ z* D% M1 G- H; L+ h5 g
( o% C+ \( L. G' x  Rstatic void do_it(void)2 X! `+ U8 H9 N3 O# o& T
{
1 `7 Z% `1 u& e0 i    Session *theSession = Session::GetSession();
" P- d9 F4 q; F    Part *workPart(theSession->Parts()->Work());
' k1 O- k5 [, i0 J7 Y; ?) K    Part *displayPart(theSession->Parts()->Display());
* n) I$ ?. N6 a, ]8 ^1 H* ]   
- u4 L. P8 S: l5 J* D, l    PDM::SessionSettings *sessionSettings1;! t" p4 P  u6 c6 V6 \
    sessionSettings1 = theSession->NewDatabaseSessionOptions();( s8 |3 x  @4 {8 l4 u& C
   
( U+ g* c/ h# H8 U    NXString CurrentGroup;
0 t) y- C' [( S) w% L    CurrentGroup = sessionSettings1->Group();* k( Z  z6 R) S& O3 T9 P, `
    0 U2 @+ n+ W* p0 M: [7 d; R5 \- Z
    NXString CurrentRole;' i. J: W- S+ l+ a0 Z* u
    CurrentRole = sessionSettings1->Role();1 u& \, S$ f" G. I/ O
' f' q! q( b; J
    theSession->ListingWindow()->Open();* b4 s& [4 o" W) k( b
    * u4 {) J- Y; v
    theSession->ListingWindow()->WriteLine("Current Group: ");  q8 Q: ?" B" L0 o6 s, L: P
    theSession->ListingWindow()->WriteLine(CurrentGroup);# v: e+ `( y. I8 b
        
" l% G" f% ]& J' [$ h7 p    theSession->ListingWindow()->WriteLine("Current Role: ");    3 d+ O2 G1 W0 ]* D. @* u
    theSession->ListingWindow()->WriteLine(CurrentRole);3 z' K8 l/ l& X

& o0 b6 j% H$ U; o  ^}7 ^. V# E) ^% y* s) @

, I5 s9 A( ?% x, J* @7 j) N- U; ?3 t1 @
  s8 Y. b- u9 e0 b
该会员没有填写今日想说内容.
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 注册

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了