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

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

[复制链接]

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

320

主题

226

回帖

9784

积分

管理员

PLM之家NX|TC专家

积分
9784
发表于 2014-9-27 21:10:30 | 显示全部楼层 |阅读模式

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

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

x
UG NX二次开发源码分享:Teamcenter集成环境下,报告角色和组
' T' \$ M) e. [通过NewDatabaseSessionOptions,可以获取teamcenter当前账号的组合角色!: R  H' a' b, Q5 a$ Y# T2 W
这个类也可以实现设置组,角色,获取卷等操作!1 \9 s; Z  i) x" {" \
5 c# X1 R' |8 f7 M# J$ w5 \& v" M* K
0 U$ ~3 _& r" l$ n
std::vector< NXString >  GetGroups ()
! T7 U2 I. i( |  p  Gets the names of the Teamcenter groups to which the user belongs.
$ J* x7 f* Z0 ~" A  f 2 S7 x: B( o$ L! G4 _- s! i( [
  
! A1 p" ?0 |; N7 ^; |0 \std::vector< NXString >  GetProjects () . k$ e) o5 |' 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. 5 E- N3 F& n: F( v
$ ^) m; N+ V# F1 |6 n
  ; R) U- {. V4 T  t9 y; E
std::vector< NXString >  GetRoles () 1 v% u: |5 l% J) J$ A
  Gets the names of the Teamcenter roles in which the user may act, given the current group returned by PDM::SessionSettings::Group . 5 q9 G6 c! j& r0 D) t
4 E1 s) k: ~% B- F' I
  
% ^, w) c: V6 Q) m2 b* e. Fstd::vector< NXString >  GetVolumes ()
0 {; C9 j. p. h6 t  Gets the names of the Teamcenter volumes which the user may use, given the current group returned by PDM::SessionSettings::Group .  % O1 x' W' T4 X8 K; t: V
( @8 [; e* n# @. ]
# D$ y0 F0 @0 [" v8 ^

; F% W& y, Q, j: dstatic void do_it(void)0 C9 R, G/ H  d0 q. H1 M
{+ D* q+ F' Q; f6 {1 c# G
    Session *theSession = Session::GetSession();
( K& h% [2 u& w7 ^, ?8 C' k    Part *workPart(theSession->Parts()->Work());. U2 V( S  s/ @" m
    Part *displayPart(theSession->Parts()->Display());6 k9 v" E# a9 |& w
    3 F) y0 g- P5 X( t# s
    PDM::SessionSettings *sessionSettings1;! C; T. x+ k$ e' z
    sessionSettings1 = theSession->NewDatabaseSessionOptions();
* c5 u9 D. u; ~3 k2 h3 k, V4 N    ) H% ]4 s1 m1 \; r8 t, T- b- o0 B) J' P# |
    NXString CurrentGroup;
% \* T0 _$ h( N* r( |    CurrentGroup = sessionSettings1->Group();
* N. T7 |" e9 {! k+ V   
7 ]# H' c" L5 [  `! o! c6 j  \    NXString CurrentRole;
$ N; w! ^- z+ i5 S: R: d" x    CurrentRole = sessionSettings1->Role();/ z% b  k9 |- w. m

; R4 j# t& d* M+ @% P    theSession->ListingWindow()->Open();
0 y1 L/ w/ D2 Q) [' y; R   
) K3 u% q) m6 T5 u8 z  B. C    theSession->ListingWindow()->WriteLine("Current Group: ");
9 F5 A' f- z5 K( t! }3 n* J    theSession->ListingWindow()->WriteLine(CurrentGroup);
# G+ g0 c" B& |6 W7 G( P% o7 y        
6 d# e1 R& C: r6 H: w/ J4 y$ {( i    theSession->ListingWindow()->WriteLine("Current Role: ");    2 T+ g: K+ K0 _2 s
    theSession->ListingWindow()->WriteLine(CurrentRole);- T& @% y9 h5 M6 L1 q7 n' J6 r

; q  Y$ T3 o) o- W}0 E; O- O& ]3 J+ G3 j0 Q* U

8 g: o# f( _. |, |7 p& o" g& {# K: ?2 u7 i7 z2 X
: m$ a- n$ O; w
该会员没有填写今日想说内容.
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

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

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

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

    我知道了