PLM之家精品课程培训

PLM之家精品课程培训

联系电话:18301858168   |   QQ咨询:939801026
NX二次开发培训

NX二次开发培训

UFUN/NXOpen C++和实战案例

适合初级入门或想深入了解二次开发的工程师,本培训结合ufun,NXOpen C++,大量的实例及官方内部的开发技术。
公众号二维码

关注公众号

点击扫描二维码免费在线高清教程

课程详情
Catia二次开发培训

Catia二次开发培训

市场需求大,掌握核心技术前景广阔

Catia二次开发的市场需求大,人才稀缺。掌握开发技能潜力巨大,随着经验积累将在汽车、航空等领域有所作为。
B站二维码

在线原创B站视频

点击关注工业软件传道士主页

课程详情
Teamcenter培训

Teamcenter培训

全方位培训,从基础应用到高级开发全覆盖

涵盖用户应用基础培训、管理员基础培训、管理员高级培训及二次开发培训等全方位内容,由多年经验讲师打造。
QQ群二维码

加入同行交流

点击扫描二维码加入QQ群

课程详情
×

PLM之家plmhome公众号

课程涵盖: PLM之家所有原创视频

×

关注B站视频

所有高清视频一览无余,全部在线播放学习

×

加入PLM之家QQ群

同行交流,疑问解答,更多互助

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

[资料分享] 关于NX二次开发,经典界面到RIbbon界面转换的菜单开发技巧

[复制链接]

2015-1-9 10:37:48 4278 0

admin 发表于 2015-1-9 10:37:48 |阅读模式

admin 楼主

2015-1-9 10:37:48

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

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

x
关于NX二次开发,经典界面到RIbbon界面转换的菜单开发技巧% q  A% E6 h3 h

经典界面到RIbbon界面转换

经典界面到RIbbon界面转换
$ i8 k7 G8 f  Q6 ~9 G; F5 g
在经典界面下,需要的文件$ B0 P7 H) p4 z: D. {
  • customer_men.men
  • customer_toolbar.tbr' a# }+ c" w3 A" e! h) Q7 R6 h
在ribbon界面下你可能需要的文件
: [" D7 p& W# ?
  • customer_men.men
  • customer_tab.rtb
  • customer_toolbar.tbr
  • customer_toolbar_alternate.tbr
  • customer_group.grb

    " Z$ E9 M) Z1 D& B
& D. J; p9 p/ D( m& m* ~) T7 w; F
4 j, A* {* _3 Q  O/ `. [  O2 W
举例如下:
' B. n& J8 H( s" L# |
1 R" j- n) |4 y/ O. c
& \, }5 y% @% X) j9 s0 ^4 L0 ~customer_men.men
. b7 }/ ]" N2 e5 M, F, L8 U!
) h! {6 L- S+ z6 `* i: Q!  Customer menu file  q1 N- g2 Z2 q3 z% j& c
!   }  z- y5 b9 J- ]
!  Contains button definitions to be used in
$ \8 q7 `/ ^! K( ?. C8 s!  toolbars and Ribbon files
! P3 S  z" A  _* L& `!
/ `9 D( \  s! K+ W2 }  `8 S4 q6 X; T6 p1 U
VERSION 120" `( b! {1 p, f- E: c$ K
7 J, |7 K+ ?" b1 Q! v
EDIT UG_GATEWAY_MAIN_MENUBAR0 |% O4 |) g5 }* y: ]5 ~
/ _4 k. `) U" s$ V
TOP_MENU
2 _9 o3 v7 V: i    CASCADE_BUTTON CUSTOMER_MENU$ w1 Y/ y# E; v& P5 ^
    LABEL Customer Menu& I# U* j4 y$ D' X3 _

$ g7 d$ p+ t8 bEND_OF_TOP_MENU
& p# {+ U( Z: l( B* l* i; t( A
. }" w, x& _1 `# ?MENU CUSTOMER_MENU- i3 H5 y: U* w* k

* p4 t1 g3 E; ?8 b) d    BUTTON CUSTOMER_BUTTON_1
) t  c$ G. k' _' U9 R    LABEL Menu Button1
9 H" Q) B- p% S) K8 w         RIBBON_LABEL Ribbon Button1. u( `2 C! h# x
        TOOLBAR_LABEL Toolbar Button1% ~/ Z8 y2 f9 t9 W. |
    BITMAP fileopen4 V! `" l0 T. e* s) S: _9 _

: H# X  O$ ^& ]# H9 ]    BUTTON CUSTOMER_BUTTON_2
# ?7 O1 k  G& t7 Y& O) Z2 t( \! n    LABEL Menu Button2
3 k8 ~! ^# ^* q6 T        RIBBON_LABEL Ribbon Button2
0 q2 q9 f3 P. r3 N2 x3 y        TOOLBAR_LABEL Toolbar Button2* C" e+ d8 x4 @3 G" ^
    BITMAP filesave
! t9 X1 N" N! m! x% W" c/ Y7 x& ?: _0 D# h5 [
    BUTTON CUSTOMER_BUTTON_3
* n2 w5 w) k0 Y$ j5 O    LABEL Menu Button3
: ?8 L: U  M$ w" |6 {) N        RIBBON_LABEL Ribbon Button3
, m) A  b: {8 j2 o( }        TOOLBAR_LABEL Toolbar Button3( a  H& H+ W( A9 v/ h. u, J
    BITMAP current_feature
( l) }$ |+ H3 Y" O2 O; ?: J# K9 R3 a! w7 t! K+ \, H
    BUTTON CUSTOMER_BUTTON_4: `% y5 u- L8 l/ T/ v' o* P' \4 S
    LABEL Menu Button4
% o$ u: J" t* S        RIBBON_LABEL Ribbon Button4
8 N* w# {  t, A0 }        TOOLBAR_LABEL Toolbar Button4
+ A, {3 T# q  f( V    BITMAP block% V% X! p5 D) t( G: ~" Y, r
7 Q. b, h( A& r# D
    BUTTON CUSTOMER_BUTTON_5
: i& M' [6 w/ I( h4 e+ w    LABEL Menu Button56 n% V+ D: r, p- z
        RIBBON_LABEL Ribbon Button5  n2 l" a9 D! v- S' r
        TOOLBAR_LABEL Toolbar Button5) |/ y, N" h3 D5 X5 \5 v
    BITMAP checkgreen
% p% c0 l( A4 n* P
) R, S% |0 e7 }& a* X; Y( wEND_OF_MENU& ]! z  N8 X# C+ U+ p9 J

! K& [: x3 E+ o+ X8 D; \/ |, S; i8 ^5 ]0 c
) }* i: T+ O2 \  ?6 U3 P3 ~
customer_ribbon_tab.rtb
* M. @2 J, E5 }* u! v!1 _* |' z; j  H
!  Customer Ribbon Tab
0 E- E/ S# G; \1 q, w- |: z! 0 f+ [' l% A- S, N8 p4 f
!  This file will create a new customer tab containing three groups and: \/ I3 s" \& s
!  one top level button.
1 E' o3 w6 D0 N1 |!. E2 e- u4 ^) t+ x

% w9 W- y/ b9 l  n, ]& `2 lTITLE  Customer Tab
5 K$ S8 d7 e( A+ d: mVERSION 170% E) S4 i- i/ w/ w
) Q  }, v6 ~. o& W, Q0 }, r
!  The first group represents a Ribbon group that references an existing 1 M1 w0 ?; @3 C) ]
!  toolbar with no Ribbon style changes.  
+ p. e3 }; i  ?, h  j! ( }. I' w1 h: o+ i
!  This is the quickest way to add existing toolbar content into Ribbon mode.
1 {3 c& B0 Z( j7 m!
& o8 e! e: v" f9 }: _8 w' WGROUP  customer_toolbar.tbr
" B: w- B8 V% ~* ^& M6 f% H- F0 o  Y; s  o+ b) F
!  The second group represents a Ribbon group that references an existing , M! G0 k7 H* A# c6 I3 z; S4 I
!  toolbar with Ribbon specific style changes added to it.  There is no difference' H) w9 P  G: q8 `; A0 z
!  in how this toolbar is referenced in the .rtb file compared to the first
1 m4 L( C8 O3 {# U* k3 b7 b!  toolbar as a group.  The only differences from the first group exist within
) R9 O( W5 B: o2 H* B8 u!  the .tbr file itself.
; t; @- C2 D3 \( V. E!
2 a5 p4 }; r) A9 @% x9 ^' z!  This approach has advantages for customers that will deploy both Ribbon and* |/ {" O0 Y8 F
!  Classic Mode customizations since all the content is defined in the .tbr
0 f1 s! C: G! E9 u/ h!  file and it will stay synchronized in both modes.  Only one set of customizations
5 Y3 Y; Q/ A6 V!  will need to be maintained while still making use of RIBBON_STYLE to $ t$ e- |: N7 z+ c4 Y
!  control the presentation of the buttons on the Ribbon.
/ p; y# g, U  u- i6 G' i1 T! b!
- l5 w; m" ]5 T* W9 n5 J: YGROUP  customer_toolbar_alternate.tbr
! k1 b, G& L7 E2 w
4 P- m5 D5 g3 `9 l) \7 [# n: B!  The third group represents a Ribbon group that has been created explicitly: t2 U; N9 c# R2 E- A
!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the0 i2 V- R9 a* V7 y/ l
!  preferred option since the user will be able to take advantage of all the / y4 \5 }, b* C9 r
!  layout styles and containers offered by the Ribbon.  3 i1 C/ n, R, c2 _# e' M; y; J; b
!2 T2 q2 O# h) J/ p, O
!  For customers that will deploy both Ribbon and Classic Mode customizations, 2 ^/ m5 F  E6 b! [- w
!  this approach will result in no synchronization and two sets of customizations
- U, ^9 }5 \$ V  @, E) T. ~: x!  will need to be maintained.
6 I7 y) V$ P, x7 u1 H- t!
3 ~4 K  {8 w- G0 I!  A group can alternatively be defined directly inside the .rtb file by using the4 C9 L5 m9 V9 B: d7 N
!  keywords BEGIN_GROUP and END_GROUP.  0 e1 [4 h" ^* a0 n6 A- u$ B6 h
!
0 J' g# V" @) {; s" LGROUP  customer_group.grb
4 b; ]. z) `, L/ q0 {3 O5 U8 u4 B5 T4 E% Y
!  Example of a button that is placed directly on the Ribbon without being0 e3 ?/ z/ E( O  C2 Q/ x6 U
!  contained in a group.  This is a simple way to add a button to a tab
: f0 ]3 ~6 @5 ]" s! Z2 S!  but is not recommended for many buttons since groups have advantages.
% w6 W- I) T! y. F+ R& `!  + k; v( S5 ?/ _4 W3 W; m4 U2 l
!  A few advantages of groups:2 t( B7 `/ p  L7 V6 o
!     1. Easier to move many buttons around together in quick customization.  
  E3 b3 z3 G$ t4 g" y5 Z# X. @7 h!        For example, MB3 on a group and choose "Add to Left Border Bar".  2 o3 o! {0 V: B. V( K
!        This will move the whole group to a new location.  If buttons are - m& }" |. v/ x1 _( M0 E5 |4 S
!        not in a group, they need to be moved one at a time.
5 {( }/ h9 J: V5 ^!
3 f2 w. }7 j6 |$ e& Z: F!     2. Provide a label to describe its contents.
/ \3 B/ n2 |1 c. ^5 r1 J0 e. C!" M( P1 Z4 x) o% A
BUTTON CUSTOMER_BUTTON_1
7 U) W9 Y2 [/ O+ XLABEL Button1 Directly on Tab
9 w& Y' J" z, o8 H+ {5 {2 K4 p9 J/ y. s$ g8 Y+ b0 S# x
1 I% R/ z( X3 \
/ a* `; z% V2 S: a9 o
customer_toolbar.tbr
) z- x0 N$ V4 n9 m# T1 _!
9 `; ?" V$ |3 a* a9 k!  Customer Toolbar File( I* ]' ?) J" J1 M" L; X
!- l9 e# ^( Z% r' a/ r, b' |1 _
!  This is similar to an existing toolbar file containing
/ |+ |* i; c8 \+ l, G7 x!  no Ribbon changes.
- M) G0 h1 D7 W" I6 v2 k" Y!# j7 g# C/ r) T, Q, x
!  In Classic Toolbars mode - This toolbar will still show up in the
6 f9 s! ~6 Y+ z2 E!     toolbars list.' y& e$ x* B( Y2 U" m
!& c0 b3 y" C! V- |. h( e
!  In Ribbon mode - This toolbar will be automatically converted to a 9 T, L1 Q: I' }" e  _! h
!     Ribbon group and will appear in the "Classic Toolbars as Groups"
2 U- \1 p" g5 C7 H$ D!     section in the Customize dialog.- m% k+ h- ^: @( |5 w/ ?( k
!  0 ]! \; p, Z- @7 b/ z
' Z# X9 S  `! n6 k3 Q4 l% a
TITLE Toolbar
& G! W( j* L" Q9 ^  eVERSION 170
6 _, K* Q, y; ^: K, _% c9 e( p' B  [, C3 g! W, T2 E
BUTTON CUSTOMER_BUTTON_1% @2 r8 u3 C4 J) [" u  P

; V3 M1 Q; n6 z9 I5 p' `4 SBUTTON CUSTOMER_BUTTON_2
9 E3 w/ R  j7 I! O) p/ W5 r, Y
+ d, ~) I8 z- A1 l. @) C. _BUTTON CUSTOMER_BUTTON_3/ U( a2 `, r3 N% w

( I5 E& s* z" P; B$ }BUTTON CUSTOMER_BUTTON_4$ f1 o5 m/ J6 X% q: A3 h
# K8 I- I* e6 j* B# J, U
BUTTON CUSTOMER_BUTTON_5
: F, t7 O6 A. z8 A3 I
, R- I3 \- D7 m: M
* P0 Q9 ?+ G( X6 Y' E$ s$ t* `/ \5 X- E( G* g" |/ c: k2 k
customer_toolbar_alternate.tbr1 ^1 C# Z! O/ F- ?) q
!
4 I3 B7 f$ B$ w# g5 H!  Customer Toolbar File (Alternate)0 H8 e( j- Q# H7 [1 C0 G/ p# Q
!# _9 A, e6 A% }* |5 t! j
!  This is similar to an existing toolbar file with new( N, i  o. e' ~1 k
!  Ribbon styles added.
3 ?& F& H5 `8 d" @! {$ b  g1 K$ W; K!  
, t, N  O- {) n* E4 D; f+ x0 o!  The RIBBON_STYLE will be honored when the toolbar is loaded $ F' l2 N) k$ R0 Q* @
!  in Ribbon mode as a group but will be ignored when the toolbar
! ~% B% R$ B. S- S: ^!  is displayed in Classic Toolbars mode.
4 {& ~: |$ T  E& W) N1 K* o!" Z7 c; o4 ?! p; ^' d' a
!  In Classic Toolbars mode - This toolbar will still show up in the
' {- m* O( u& n!     toolbars list.& K6 k" ]' s2 U
!/ U+ Y8 I+ V! [8 h# X1 j( r
!  In Ribbon mode - This toolbar will be automatically converted to a
& f  F6 u0 @$ j# L# p' K8 K!     Ribbon group and will appear in the "Classic Toolbars as Groups"2 L$ o6 u; E5 S* i9 x+ }
!     section in the Customize dialog.
+ V6 I  L9 S7 y! ^2 ]- n: O!
8 I2 T) R6 n, j, X
! k3 O9 e/ b, v* h2 i- M4 z9 }! aTITLE Toolbar (Alternate)3 P0 @8 e5 _7 Q/ e
VERSION 1707 ~; W$ ]6 S1 M' ]! ^

1 ~, k7 s0 x! v, H' J( lBUTTON CUSTOMER_BUTTON_1
" E, L5 D1 }$ Y# ]% wLABEL Toolbar(Alt) Button19 \$ }8 F9 s8 k
RIBBON_STYLE LARGE_IMAGE! X9 R+ V; R! Y5 c

+ k" }, Z# q( t6 `BUTTON CUSTOMER_BUTTON_22 t5 l& ~6 [6 `! \% }  U
LABEL Toolbar(Alt) Button2
7 ~$ H- B' j6 a" aRIBBON_STYLE LARGE_IMAGE
+ _  i6 f" @0 ^7 `  K
; q5 n# ?+ ~4 l. GBUTTON CUSTOMER_BUTTON_3+ M2 D9 w  s. g5 l
LABEL Toolbar(Alt) Button3
7 z+ S3 T# u3 Y  t: aRIBBON_STYLE SMALL_IMAGE_AND_TEXT
, Z- D6 {& _) o2 }' d+ s( ?; u: o5 P* J, {0 l8 Z/ ]: M( F3 Q! }3 y
BUTTON CUSTOMER_BUTTON_4
: O0 D- c* E: Q5 q) w; \/ DLABEL Toolbar(Alt) Button4
7 B0 q( I; R9 s+ T5 KRIBBON_STYLE SMALL_IMAGE_AND_TEXT
5 u' P% ^9 ~* J2 {4 h4 s
# ?. `1 E4 V, T" Y: {BUTTON CUSTOMER_BUTTON_5
$ W5 W* v. ]! KLABEL Toolbar(Alt) Button5
) m. h! I  }% H% P' ]1 uRIBBON_STYLE SMALL_IMAGE_AND_TEXT! v* S$ q. l6 U
( D% j- ?5 n3 R, k! }% Z

' P/ i0 D5 L3 i1 p1 `4 B( {; G
& B+ f0 ^1 T- x5 [8 M, `: ~customer_group.grb# Y1 Z3 q3 _7 y4 D
!  G8 y; T6 t) o) c7 O
!  Customer Ribbon Group File: h- ^0 B" V$ K
!
/ w9 M; b1 T% o% G8 a5 \: H!  In Classic Toolbars mode - This group will be unavailable
9 w$ c9 m: [$ ~1 s3 D. h!
/ @6 E+ c: |; J8 t! h) h  ?!  In Ribbon mode - This group will show up in the "All Groups" list
+ [( M0 u3 f' x$ M& u!     in the Customize dialog.0 k. D+ S2 G! N  N
!
: v3 |. I0 K# d0 U4 }!  The labels of the buttons are defined using the RIBBON_LABEL token in the MEN files
# r! j, S  f( _1 B" Z!
4 Q' e1 S1 ~" }
! V# e. G. I0 J' NTITLE Group
2 o9 ]# K/ u- S; HVERSION 170! L: G* a' @. E2 `, ^

$ r1 _3 A  \$ b. f; {  F" k!  No LABEL defined, using RIBBON_LABEL defined in customer_men.men) Q# M6 }( K: e: T( m2 V  ~
BUTTON CUSTOMER_BUTTON_1
( P6 ~" R/ n; w% U, vRIBBON_STYLE LARGE_IMAGE
, y* r1 B$ t. _3 V, p7 {' b" V; }( z6 h" D8 I. M
!  Example of a gallery defined in a GRB file.
8 v6 B4 G5 G7 Y. m# O8 u2 Z! 2 s0 c# M1 @' A& }) o+ K4 Z
!  If this gallery is to be used in other places, then it could be
. P6 l' f7 U, m/ @) }4 S!  defined in its own gallery (GLY) file and referenced here
0 j4 @: c+ Q1 L7 o) e) K!  Example:
3 y- m9 U8 G6 _3 n  C5 |!    GALLERY customer_gallery.gly
! ]5 y$ S2 D) q' Y' }) w!
; B. m) C( j9 H( W" t' [BEGIN_GALLERY  CUSTOMER_GALLERY
; ~5 n7 T; Q. N# |" z2 kCOLUMN_IN_RIBBON 2
# d9 Y5 |- ~$ @COLUMN_IN_POPUP 2
% W) S6 M* H9 ?9 v9 ]LABEL Gallery' c6 p$ v' O: R& v" V5 p' _  \
GALLERY_STYLE MEDIUM_IMAGE_AND_TEXT' ~+ n- x8 j& Z! Q( }
5 L; |' }* t0 i* ^# u+ g2 x! j
    BUTTON CUSTOMER_BUTTON_2' h7 p. O, Z3 [0 W: w) h7 u

* ?  a) G' R) {8 R# M; z    BUTTON CUSTOMER_BUTTON_3+ z: Y- {7 d3 F4 E7 U

6 C1 Z$ P- J& @- p- z! Q/ I/ M$ Y    BUTTON CUSTOMER_BUTTON_4
8 ]! a+ l1 j% h2 s) i) |3 M! m0 ?8 d' r6 x3 ]( T/ @2 `; E
    BUTTON CUSTOMER_BUTTON_5
& l- W1 z3 p" j# B$ S: z4 S2 C
" H. W( }/ W! EEND_GALLERY3 R9 X# L- M& @8 `+ c1 @" G; `3 @1 Y
' B- M( B" G6 v3 e
3 C8 Z) f2 y9 j
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.diantuankj.com/ doTeam.tech
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

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

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

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

    我知道了