PLM之家精品课程培训,联系电话:18301858168 QQ: 939801026

  • NX二次开培训

    NX二次开培训

    适合初级入门或想深入了解二次开发的工程师,本培训结合ufun,NXOpen C++,大量的实例及官方内部的开发技术对于老鸟也值得借鉴!.

    NX CAM二次开发培训报名 NX二次开发基础培训报名
  • PLM之家Catia CAA二次开发培训

    Catia二次开发培训

    Catia二次开发的市场大,这方面开发人才少,难度大。所以只要你掌握了开发,那么潜力巨大,随着时间的积累,你必将有所用武之地!

  • PLM之Teamcenter最佳学习方案

    Teamcenter培训

    用户应用基础培训,管理员基础培训,管理员高级培训,二次开发培训应有尽有,只要你感兴趣肯学习,专业多年经验大师级打造!

  • PLM之Tecnomatix制造领域培训

    Tecnomatix培训

    想了解制造领域数字化吗?想了解工厂,生产线设计吗?数字化双胞胎,工业4.0吗?我们的课程虚位以待!

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

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

[复制链接]

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

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

mildcat 楼主

2014-9-27 21:10:30

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

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

x
UG NX二次开发源码分享:Teamcenter集成环境下,报告角色和组4 L5 v; l1 |5 x5 S
通过NewDatabaseSessionOptions,可以获取teamcenter当前账号的组合角色!9 S' K: |* ~# ^( j  q+ c7 X- d
这个类也可以实现设置组,角色,获取卷等操作!
/ d1 A% r3 x# v7 G* ^4 @2 _" s' N0 F( Z0 v6 m
1 H& Q8 F% N$ t2 @
std::vector< NXString >  GetGroups () % Z2 _6 D; ~# `# f
  Gets the names of the Teamcenter groups to which the user belongs.
/ Y* m% Y# C2 P- X- N8 Q$ S 9 D- j" P) Y5 i) ^
  
0 m6 d& B0 @" c4 k* b8 Hstd::vector< NXString >  GetProjects ()
( A: ]' ]4 ]2 q3 l' N6 ]  Gets the names of the Teamcenter projects to which the user belongs also the first entry of the returned projects list is always empty. * m3 `9 t  ~0 {7 |8 m6 {
* D8 P8 F9 w* L1 U0 v
  5 t7 k) ]: l; B7 U. |3 K
std::vector< NXString >  GetRoles () 3 d: Q2 ]+ k* F- r9 J5 H- D
  Gets the names of the Teamcenter roles in which the user may act, given the current group returned by PDM::SessionSettings::Group .
! b" G1 {/ u3 d& h  N! b. s- x- x, C, D
6 o# N4 Y1 k" ?7 ~  B  
% N' @, w& p: L( z$ E' N, t& I% @' mstd::vector< NXString >  GetVolumes ()
% M* W- @+ r' m. {& {$ B) Z) b  Gets the names of the Teamcenter volumes which the user may use, given the current group returned by PDM::SessionSettings::Group .  
4 V+ \3 @1 V$ f# ~$ ^

) D! N! q# h6 k  _4 R5 X$ a. R5 I9 L5 J% A
! s3 I) T4 N: M
static void do_it(void)! P" P( u0 @# T! h9 f+ e3 N
{
2 D& E  J( m* T7 ]    Session *theSession = Session::GetSession();, C9 G" u7 k% l) R0 K
    Part *workPart(theSession->Parts()->Work());
. t  D& r. W! K1 t0 b2 x0 E0 W    Part *displayPart(theSession->Parts()->Display());) r7 q. M0 k5 j. S: t; ]' W7 H
    : k3 Q: v- q4 ]5 I! Y
    PDM::SessionSettings *sessionSettings1;
' U$ Q; _- N3 H    sessionSettings1 = theSession->NewDatabaseSessionOptions();
. G# k, R" K, t   
: _3 g6 \4 a, K6 h/ Q2 h( `7 g    NXString CurrentGroup;( q! @& ~6 w6 Q+ N: p
    CurrentGroup = sessionSettings1->Group();7 ]8 d" w5 R% w
    7 I' P) r* I* {
    NXString CurrentRole;
: V2 I9 X2 B. S( C0 E8 |    CurrentRole = sessionSettings1->Role();
7 l1 ^! _- d' N  X7 Q, B( b
0 T" ^5 U. h! D& P# X: W/ ?$ g2 U    theSession->ListingWindow()->Open();
1 G8 y8 X# P$ X$ `# g* r2 Z0 O    4 |! f4 h! ~9 i1 Y7 x: e* j
    theSession->ListingWindow()->WriteLine("Current Group: ");% t2 c" a! j4 Z6 ^, r) Q
    theSession->ListingWindow()->WriteLine(CurrentGroup);5 u3 V# S' q% Z" S' b: u) M3 C
        % q- P% n1 y7 q; ]
    theSession->ListingWindow()->WriteLine("Current Role: ");   
2 m5 r( D. k/ X% k5 w' k9 Q    theSession->ListingWindow()->WriteLine(CurrentRole);
$ s/ u& L: S' J  G6 [8 `4 {& ?
9 B8 r( \3 y& s8 j8 E& M6 H4 a}
8 E: J0 }$ w1 P) N  U/ c. g/ G; P( g, d  c. k# s- y! w

9 @8 B6 t0 T. d6 U; C' L. N
4 `. o* a) r* i" Q, ]0 n7 j
该会员没有填写今日想说内容.
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

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

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

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

    我知道了