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 3174 0

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

mildcat 楼主

2014-9-27 21:10:30

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

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

x
UG NX二次开发源码分享:Teamcenter集成环境下,报告角色和组
# k2 U2 r: {5 j) f通过NewDatabaseSessionOptions,可以获取teamcenter当前账号的组合角色!: S. g4 M" }6 n" k% z( D- f
这个类也可以实现设置组,角色,获取卷等操作!0 H0 N; p4 D4 r$ d8 H" s' S# @

6 @. C/ u7 H  M; I% t; S 3 J8 i4 W+ T. j  f/ i
std::vector< NXString >  GetGroups () ' u" T" A7 _" w$ `$ a
  Gets the names of the Teamcenter groups to which the user belongs.
4 R  M* `) V; a& H, z3 o 0 w' N. l+ H/ n- D
  
3 f) i1 y# |) }4 }! F+ X, ^std::vector< NXString >  GetProjects ()
5 R' |7 [& x: R) i  Gets the names of the Teamcenter projects to which the user belongs also the first entry of the returned projects list is always empty. ( p' d6 A/ Y" z+ v/ w1 t9 }2 ~
" f' n7 o! Y4 M4 h& ]6 o
  6 L0 t. @  F) m3 }, p
std::vector< NXString >  GetRoles ()
4 ]% }3 j. D/ x/ V2 x  Gets the names of the Teamcenter roles in which the user may act, given the current group returned by PDM::SessionSettings::Group .
. x( S+ j1 ]$ q% ` . Y9 l7 h+ _# D
  
4 x( W( I" z  q0 i& \std::vector< NXString >  GetVolumes ()
* O3 @0 \) w" h' A, `* x  Gets the names of the Teamcenter volumes which the user may use, given the current group returned by PDM::SessionSettings::Group .  
5 Y. t2 f, E7 e$ b/ _0 |
  ^0 |! \0 ^8 d8 Y& s% G/ d
4 Z: k- K) E6 M6 O+ e& N1 ~% A8 ], Z2 j
5 m. C# [; ~* a2 z6 }* F) c, G# w. N
static void do_it(void)( W/ Q3 i) l) d( z3 o
{
* }3 m4 N+ x/ I) c% f. J    Session *theSession = Session::GetSession();" F8 M& {2 C- J
    Part *workPart(theSession->Parts()->Work());+ x( s6 n- w9 K9 L/ ^4 F' f! U
    Part *displayPart(theSession->Parts()->Display());2 E% a2 g( [0 b' S, P
    : u: \7 |8 m% ~8 M
    PDM::SessionSettings *sessionSettings1;* S* Z$ g3 m' L& u* |
    sessionSettings1 = theSession->NewDatabaseSessionOptions();
& B* C! R8 Z  S/ q/ c5 t& O9 p0 G$ @    & Q. @/ A8 N, s+ O6 n: v/ B
    NXString CurrentGroup;. [2 k$ o) ~. n% X+ z( z, I
    CurrentGroup = sessionSettings1->Group();  ]- B+ J; L( {: [1 P4 T/ P) z
   
, [# I, S$ y8 I/ Z7 i    NXString CurrentRole;
3 n" q2 s6 V& j9 S3 |! \    CurrentRole = sessionSettings1->Role();' @  @9 o% L8 A

8 T& t9 G0 H/ F    theSession->ListingWindow()->Open();
) q! I& T. c- h7 g6 M  P/ V$ Y* Y( n1 K   
9 V1 [8 d2 C/ ?* O! m* `0 a, D+ w    theSession->ListingWindow()->WriteLine("Current Group: ");9 W& j0 P5 o" y% z& D0 N4 j
    theSession->ListingWindow()->WriteLine(CurrentGroup);- P: K  u  `1 M8 p
        % B" g9 `; L" e: X! x; }1 k
    theSession->ListingWindow()->WriteLine("Current Role: ");   
, u* ^+ R( o: |    theSession->ListingWindow()->WriteLine(CurrentRole);
* [5 E9 i2 d* m9 }/ X+ e' d0 v/ l, {2 T
}
% k4 M" E6 b# [4 W, l+ V4 @5 f# ]
. F  X1 |  g4 a3 e- R. j  Y: u7 o
$ U. M+ |6 I. b; a0 H" ]8 T9 w; E4 W1 K4 S
该会员没有填写今日想说内容.
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

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

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

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

    我知道了