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

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

mildcat 楼主

2014-9-27 21:10:30

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

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

x
UG NX二次开发源码分享:Teamcenter集成环境下,报告角色和组' u3 |* j3 w: D, d( ~
通过NewDatabaseSessionOptions,可以获取teamcenter当前账号的组合角色!2 f, i& }2 N- {/ H6 A- Y% W) X
这个类也可以实现设置组,角色,获取卷等操作!7 `. @. r* E0 r6 \' H7 B! B( g' j

0 B/ G) F  ^3 N, X
3 I4 v4 s( |! `+ N4 vstd::vector< NXString >  GetGroups ()
8 }' E% F- l6 H4 k7 L1 C0 e  Gets the names of the Teamcenter groups to which the user belongs. 5 @  s3 J) \+ G# S6 T

; ?+ K+ Z5 Y* n3 t' U5 E: ?- x" Z  
9 @9 M$ o5 M6 S: Z1 Hstd::vector< NXString >  GetProjects () . [/ \1 R% 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.
/ B! p* E1 E3 ]- N 4 _% f# T  T5 y6 }
  
& Z( F7 }( q  I/ S/ `std::vector< NXString >  GetRoles () + ^& {! z% P, l$ g3 j- C
  Gets the names of the Teamcenter roles in which the user may act, given the current group returned by PDM::SessionSettings::Group . 6 `, X! o( e" [% c

( ~$ J/ \7 c4 |; g( r" a6 k; L) b6 T5 a  
% O9 m& J% Y" m2 cstd::vector< NXString >  GetVolumes ()
3 k# m: j0 j9 @* ]6 M  Gets the names of the Teamcenter volumes which the user may use, given the current group returned by PDM::SessionSettings::Group .  
, O- a8 l! S) X1 h
8 v6 k- B$ {5 C$ N' {2 j7 ?" j

. V; p. Y1 T" ^9 M: r4 {. B2 A( i& a  H
static void do_it(void)5 `* |( }( ^( Q+ U8 B; Q, o
{# ?% _8 ~5 V  e: I; Z" Q" `
    Session *theSession = Session::GetSession();# g2 N* M9 s# U6 Y' s
    Part *workPart(theSession->Parts()->Work());( T, x; Q: r6 p3 y. a/ E
    Part *displayPart(theSession->Parts()->Display());
; O3 z9 c7 y1 q$ D9 q   
- Y$ ^8 Y# l! b. M) `2 q9 d    PDM::SessionSettings *sessionSettings1;" V/ u1 d0 B) h0 e9 z1 d( _
    sessionSettings1 = theSession->NewDatabaseSessionOptions();
7 y& j, ~$ t# _3 v; _! a: b    5 D* Y9 ]; t/ R
    NXString CurrentGroup;
) D  d; I5 M* @5 K3 g5 a    CurrentGroup = sessionSettings1->Group();; C3 M: D, o2 c5 u$ X
   
( H5 U" O/ S9 ?    NXString CurrentRole;
3 i' x5 K2 i# _& |# \0 J( I1 u    CurrentRole = sessionSettings1->Role();
4 w! _% u+ D* w: N5 B/ {8 W% t2 X( }/ c6 K0 V4 a3 }" Z2 [8 {, o9 Z
    theSession->ListingWindow()->Open();. e, A* ~! }4 v9 v1 I
   
4 l  ]0 X1 D+ Q# [/ B$ f/ W: _4 \    theSession->ListingWindow()->WriteLine("Current Group: ");( P( x3 X1 F& m8 O" n! T% c- o7 ?
    theSession->ListingWindow()->WriteLine(CurrentGroup);: K2 ^% f$ f4 p4 G' r& R5 n6 i
          O0 X* k8 a# \* l7 y9 x
    theSession->ListingWindow()->WriteLine("Current Role: ");   
* Q# }! M& x' R; p    theSession->ListingWindow()->WriteLine(CurrentRole);
* c9 _3 c/ ^6 z1 K7 {2 J$ b/ S3 y# y8 }1 K2 a
}
0 Y2 q- R+ b& V* }- J. y' }! r. r( _! z- m+ U0 ?" @% H/ `

6 Q$ h$ x* }% n% l0 y9 U5 z
3 Q6 F/ a& v# E7 j8 D( M% D/ v+ d3 H
该会员没有填写今日想说内容.
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

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

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

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

    我知道了