PLM之家PLMHome-国产软件践行者

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

[复制链接]

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

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

mildcat 楼主

2014-9-27 21:10:30

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

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

x
UG NX二次开发源码分享:Teamcenter集成环境下,报告角色和组' y) p) H1 l3 r% w+ x  S$ a9 d
通过NewDatabaseSessionOptions,可以获取teamcenter当前账号的组合角色!
) I- k8 j1 n" w7 N  z; G# `& i这个类也可以实现设置组,角色,获取卷等操作!
9 A/ a' f$ `# Q4 r7 J) [8 P+ M* M6 x; `& N# l" z" p

" z3 T0 X1 e# y5 nstd::vector< NXString >  GetGroups () 1 @3 q9 }7 x* r/ o  B" ~6 q% X1 u( {
  Gets the names of the Teamcenter groups to which the user belongs.
9 U+ h; f. r# _6 k9 ^; U  G" U! L) P 9 W) `! [5 R- l9 ]1 _( l
  
1 L% S" c* a  [7 C% z: cstd::vector< NXString >  GetProjects () , c, k! R+ ^" p  D0 C- S* U+ Z
  Gets the names of the Teamcenter projects to which the user belongs also the first entry of the returned projects list is always empty. / l. L# ?0 Y" b* E# [
: D$ u9 I% Z0 s% N* u
  " T& X/ p# g$ V* e
std::vector< NXString >  GetRoles () 0 a9 P7 t6 ]2 `: y
  Gets the names of the Teamcenter roles in which the user may act, given the current group returned by PDM::SessionSettings::Group . ' L+ v8 z% |9 l8 l$ n7 `5 D
$ R6 j( J2 R" x: n
  
9 [. U  }% ]9 J! p- ?std::vector< NXString >  GetVolumes ()
6 [2 [) Q! Y" T7 c9 u4 _- M  Gets the names of the Teamcenter volumes which the user may use, given the current group returned by PDM::SessionSettings::Group .  
9 e4 _$ U+ v9 u
0 h; [% R' z- f1 g$ D) \. \
' X- c# Z5 j2 @- q
% `9 q  c. @% [; r  [+ Z" V4 [5 a1 ]
static void do_it(void)
! S+ e% V: x' N2 H{
6 a3 p- E6 [' m  ]- M% d' Z* F% k    Session *theSession = Session::GetSession();
% x$ \( c& Z: I0 J% c4 M! V' o    Part *workPart(theSession->Parts()->Work());
& \/ V. ]) p2 F7 \& x" A* R! {! x    Part *displayPart(theSession->Parts()->Display());
; M8 \3 R" L. q9 n# A    + W4 }- X2 b4 `- p+ h- a/ K
    PDM::SessionSettings *sessionSettings1;% `* _6 t( }9 x! }
    sessionSettings1 = theSession->NewDatabaseSessionOptions();
+ j6 U7 D3 k8 O! D: i/ w6 o6 \- t   
1 O" B& A# j, ]( z; {- B, H    NXString CurrentGroup;
& _; D$ p: o# c    CurrentGroup = sessionSettings1->Group();5 T/ R, j" [6 H9 W
   
' i( w6 u% v7 y  O) D! @    NXString CurrentRole;( H9 J2 e" p8 X5 ^5 D
    CurrentRole = sessionSettings1->Role();. Z* m5 U% F% j4 e" Q( A( u5 z8 k# V
1 A$ l. b3 g. g1 B1 a( J) |; _
    theSession->ListingWindow()->Open();2 R  U' b/ T1 Q- y
    7 U7 ~1 U* k$ e) k* Z. o
    theSession->ListingWindow()->WriteLine("Current Group: ");
% n1 R# N) `0 _, _' V    theSession->ListingWindow()->WriteLine(CurrentGroup);6 w" s9 d5 i( ~& }2 O# |3 y" A5 Z! J
        : O, O; Y7 X' w% ]
    theSession->ListingWindow()->WriteLine("Current Role: ");    1 T/ l& [. _9 o8 J  i$ L, G/ o4 N
    theSession->ListingWindow()->WriteLine(CurrentRole);
4 h. J4 _* T& X9 {
  o  S1 f$ C; b6 S# L1 j6 v0 z9 C" z}
# ]; y9 k4 H8 e  |
4 S  \& o1 K8 ?6 X. g/ |9 {# _  S8 {6 i0 p

" q" d9 E' C! M# E
该会员没有填写今日想说内容.
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

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

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

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

    我知道了