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

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

mildcat 楼主

2014-9-27 21:10:30

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

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

x
UG NX二次开发源码分享:Teamcenter集成环境下,报告角色和组
+ `' M& X6 `% F8 T- _% V6 u通过NewDatabaseSessionOptions,可以获取teamcenter当前账号的组合角色!
! M' a8 s- q" d; L# I, v% V* D这个类也可以实现设置组,角色,获取卷等操作!6 I/ I2 b/ Q4 I6 [; G1 l
/ Y  d2 q! q0 `6 D
8 x' t& z3 P& r% _, K2 a
std::vector< NXString >  GetGroups ()
" \  G; o$ O; {; ~, l. K  Gets the names of the Teamcenter groups to which the user belongs.
. Y9 x7 i8 q' r7 h - ~. c% p+ I( W" A, K% K
  
9 A+ `9 ~+ X8 d1 }std::vector< NXString >  GetProjects ()
2 Z( s- x2 u/ j3 w4 _  Gets the names of the Teamcenter projects to which the user belongs also the first entry of the returned projects list is always empty. & f7 a/ D* F1 i. E
" [1 v) z! J+ i1 N
  $ }( v5 z) k0 H& M
std::vector< NXString >  GetRoles ()
4 p7 {5 d# A( x1 G: M9 a0 r  Gets the names of the Teamcenter roles in which the user may act, given the current group returned by PDM::SessionSettings::Group . - @. D9 m/ n) g, j6 `
3 w- h1 _6 Q7 K- f; ~
  # ?8 B, U$ ]% b  W9 e
std::vector< NXString >  GetVolumes ()
7 S/ h3 G) H1 i  g' F+ X  M  Gets the names of the Teamcenter volumes which the user may use, given the current group returned by PDM::SessionSettings::Group .  , C- G, f6 [0 F4 o3 a

% Q$ J4 c+ n0 I+ `
3 W5 R, L5 U. @8 m" ?5 |" ]( ^* G! p$ g9 s% R' f2 i. i
static void do_it(void)% x; O3 u/ g# U6 _8 R8 Y5 a# h+ \1 t
{8 E& k9 K+ M6 k7 f. m3 O) y
    Session *theSession = Session::GetSession();
0 P/ m0 r& _" n5 ~    Part *workPart(theSession->Parts()->Work());( P! W, N, u* p4 L2 \
    Part *displayPart(theSession->Parts()->Display());/ X2 }: C; n* d# d4 I+ G
   
- I; G5 n% k  }8 A- J3 U+ e5 \, V    PDM::SessionSettings *sessionSettings1;
! N! u8 a; x: R) p6 v$ ]    sessionSettings1 = theSession->NewDatabaseSessionOptions();
2 D5 ?+ M- m  z' {& V2 [6 `6 C* N6 u   
) b' y( U. u3 w5 t% W7 H( O, r    NXString CurrentGroup;$ c' u! M* P! k0 X' k! w
    CurrentGroup = sessionSettings1->Group();
) E* N. T0 q( }$ Q0 R   
6 H2 G4 w; n$ H$ s/ c  d) ~    NXString CurrentRole;' i3 ]- l' i3 O
    CurrentRole = sessionSettings1->Role();
1 b, a! g" i! a' ~& e" {0 L. ]$ D
% o, ?3 \: G4 b2 s  _* B- T8 M    theSession->ListingWindow()->Open();3 |6 I8 }2 r" _( k' V" E
   
4 F# C' `8 _% A2 L0 _    theSession->ListingWindow()->WriteLine("Current Group: ");
0 N/ [! j0 n5 y" ]! N2 I! I    theSession->ListingWindow()->WriteLine(CurrentGroup);
' f" x0 X9 n# ]( U2 s0 |        
4 U4 `  D3 o5 r    theSession->ListingWindow()->WriteLine("Current Role: ");    . Z3 k3 s: `9 b2 y& S/ i5 u
    theSession->ListingWindow()->WriteLine(CurrentRole);) L! L$ Q! i# p, K$ B9 }
& m' C$ _& ~2 f+ n. Z
}/ c* v% e- x- m  r
& a, v# @& Y/ f/ A; t
3 d( n$ x3 y: ^/ J) h# P1 F) ^
% f. z6 M! v. H2 n$ O  Z
该会员没有填写今日想说内容.
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

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

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

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

    我知道了