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-国产软件践行者

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

[复制链接]

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

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

admin 楼主

2015-1-9 10:37:48

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

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

x
关于NX二次开发,经典界面到RIbbon界面转换的菜单开发技巧
0 V$ m1 G4 e7 v; A. a* E5 Q

经典界面到RIbbon界面转换

经典界面到RIbbon界面转换
* t& m, K( t4 ?% z$ ^6 S5 |
在经典界面下,需要的文件/ ~. P( S: n3 E: P9 u
  • customer_men.men
  • customer_toolbar.tbr
    4 b6 A  v5 Y/ g0 `. O
在ribbon界面下你可能需要的文件 ) B5 E! J, ?2 A" n3 h
  • customer_men.men
  • customer_tab.rtb
  • customer_toolbar.tbr
  • customer_toolbar_alternate.tbr
  • customer_group.grb
    & J0 e+ D5 |" w- s& M) H+ ^
4 [$ g, J+ P- n3 k# q

* {! Q: Q- K  Q/ N2 V举例如下:
0 y$ k* \5 `% }7 Y1 y
- ?4 o3 ]9 |# Z" @4 ^( U  B2 T+ F! }( t; c4 ^* Z+ D# }3 M. I
customer_men.men! I% {2 q) t& f
!
+ K, ?" L9 `, R( W( H2 U7 _2 U!  Customer menu file1 Q9 R  ]; Y/ R3 v# J7 N
! " M7 O. l9 e+ V, O
!  Contains button definitions to be used in 6 }2 ^+ R7 f7 w0 g
!  toolbars and Ribbon files) g0 ?+ P8 E- }0 j* h7 Z
!
% |- \' ^8 j" H& }9 Z) o
8 G( T$ m% k9 ZVERSION 120
3 J3 x6 |0 S1 f
; `# f$ e1 X8 E& A) DEDIT UG_GATEWAY_MAIN_MENUBAR
) N1 j' z8 ]' O( b% ]& G9 }+ t9 ]: x# l/ c
TOP_MENU/ ?# q" x5 N0 z9 Y- Y& k
    CASCADE_BUTTON CUSTOMER_MENU
. E/ ]7 g& S! V5 @5 y    LABEL Customer Menu
+ x: A9 I/ X. j9 r1 t: C& x4 [9 H& p5 \. }+ _9 O( {, }
END_OF_TOP_MENU
# M: b% L3 `" h- w3 B; f) A3 S& `" X
MENU CUSTOMER_MENU) n- m( `% q1 l/ d* L- p- g
9 [& A4 }9 c$ H6 v% O: i
    BUTTON CUSTOMER_BUTTON_12 s( T$ J1 }+ x* E8 o
    LABEL Menu Button1
; m1 E  ]7 s$ N; w1 p4 Q* E         RIBBON_LABEL Ribbon Button13 M8 Y+ G2 J9 y3 O
        TOOLBAR_LABEL Toolbar Button1
( o0 C$ N2 D% J5 o& P1 t    BITMAP fileopen* ]/ v7 ?" a7 A7 {! t% v2 j

( r4 r' p6 G' S  A    BUTTON CUSTOMER_BUTTON_21 n& ]7 d. h; v: h( g1 Z+ G4 J
    LABEL Menu Button21 I( {5 L7 E% q1 |6 x2 p" o
        RIBBON_LABEL Ribbon Button23 l2 {0 C0 p1 Z. ~
        TOOLBAR_LABEL Toolbar Button2
) w- F. S" V0 j    BITMAP filesave* f( u; S( o! u) i8 h! N* |3 d1 a1 ?

$ S7 ^5 e$ w. `4 @% n# x    BUTTON CUSTOMER_BUTTON_3
  o- h& f; \: l4 [, g    LABEL Menu Button3# o3 e0 N; |3 I
        RIBBON_LABEL Ribbon Button36 ^& u1 m! S: @) Z
        TOOLBAR_LABEL Toolbar Button3( C" n- |  D) `% R* _* S
    BITMAP current_feature
) N( j4 ~" V2 Q) U
1 y  P+ q; K: j0 T$ Y; h& x" C0 V    BUTTON CUSTOMER_BUTTON_4
# w+ X) R- K9 \' P) X    LABEL Menu Button43 s) Z% S6 D9 V1 I+ d0 ^
        RIBBON_LABEL Ribbon Button4
9 X' B0 E  D3 `9 |) |0 N& i        TOOLBAR_LABEL Toolbar Button4
8 o. _5 n7 w: t3 ]2 Z  o    BITMAP block4 f' M0 F# A( F* ^: H, E

% R& ]  q' k( M( @; ?    BUTTON CUSTOMER_BUTTON_51 c% A' ?& P4 p
    LABEL Menu Button5  S" f6 c! O4 R2 e' e
        RIBBON_LABEL Ribbon Button5
% H4 Y: Q' p' F0 R  ~: s9 q        TOOLBAR_LABEL Toolbar Button5
. r' E5 [: v; [    BITMAP checkgreen
6 N# G! \4 v* n$ X# e8 d% Q" r0 X
( v) C! i0 ]1 b% \END_OF_MENU
+ `+ \6 g$ d. d3 D' e
2 ]' q* b5 p+ V; l* Q! m) R4 S; v9 ^4 C) s; C- T3 z5 F/ ~

" w- f9 {; y. k6 K1 I# @+ }$ `4 @+ [1 Pcustomer_ribbon_tab.rtb2 L% L1 \: x7 S: O  Y2 A6 p' h* Y" I
!
' A1 @9 J( m) J9 H& b0 I6 Z1 x!  Customer Ribbon Tab
4 ~( t, j( P' C( D" d! * X. K+ ?" c' _6 ]: R
!  This file will create a new customer tab containing three groups and  _5 D& O+ K" `' q) U6 c4 r
!  one top level button.
! ]( w: l6 Z2 S7 d' P5 S!) |* F- A  ~8 E& T; s

- M/ W5 A- Q: T0 |& @# y2 z6 }) [TITLE  Customer Tab
- t. E! s% s* X1 d  A# SVERSION 170
9 d" R; C2 ?* Y% |5 E* d8 m5 u/ k) V& g+ N- T
!  The first group represents a Ribbon group that references an existing 9 N- ^9 e7 ^+ r$ u0 E, Y3 o
!  toolbar with no Ribbon style changes.  " m" G+ d- b  b! P5 Y0 A% D
! & K& L# ~  Z3 I( s3 n
!  This is the quickest way to add existing toolbar content into Ribbon mode.6 _8 a5 A/ ~# A- j, g
!
2 V. H3 p1 N. S, ?GROUP  customer_toolbar.tbr& J4 M+ e0 ]; d5 ?5 W% R

/ o, a$ S/ h* u. g* u! ^3 B!  The second group represents a Ribbon group that references an existing ' ^. X. q! N! t' `+ K+ v
!  toolbar with Ribbon specific style changes added to it.  There is no difference
- K( t: h4 L7 u/ h1 S& Z! {/ g/ J!  in how this toolbar is referenced in the .rtb file compared to the first
% p. D6 P" v+ V  O2 S: v!  toolbar as a group.  The only differences from the first group exist within - j, V) n9 p2 e! L; U9 e
!  the .tbr file itself., h2 |" w# T( |
!
" @# o9 g2 q) u! s# _!  This approach has advantages for customers that will deploy both Ribbon and
, J; O! f% r2 M5 H!  Classic Mode customizations since all the content is defined in the .tbr
6 F% T! G* b# K* p4 Y!  file and it will stay synchronized in both modes.  Only one set of customizations
7 F3 H9 K5 U- u# {  O% F!  will need to be maintained while still making use of RIBBON_STYLE to ' w* I8 p4 M% Z* @
!  control the presentation of the buttons on the Ribbon.
4 z% r7 v4 z3 n4 x* w!; S2 o& o4 v" j. b4 |) ~0 i
GROUP  customer_toolbar_alternate.tbr
) u" H' Z9 W6 `9 `* A$ \* X& n% T% l. u0 O) i) k# U
!  The third group represents a Ribbon group that has been created explicitly
" P) n! v# Q, v7 Q1 y* }) m!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the
+ B; _7 a: e8 R5 ^5 Q( J!  preferred option since the user will be able to take advantage of all the
- `' _- e3 Y) `8 O. s3 o!  layout styles and containers offered by the Ribbon.  
' X/ r% A5 {1 i: I& z!
  O* Y8 R, I: V5 a. e' R5 H: o!  For customers that will deploy both Ribbon and Classic Mode customizations,
* Z& S; u/ R" p& Y9 M+ j!  this approach will result in no synchronization and two sets of customizations
# J4 H' M2 e, ]" z!  will need to be maintained.& a1 _! e; M( q
!
  O4 k9 H0 N! f$ m!  A group can alternatively be defined directly inside the .rtb file by using the$ ?( q) Z2 _6 f+ T6 N# b8 S
!  keywords BEGIN_GROUP and END_GROUP.  
& ^- L2 W4 A/ R2 _6 ]!% i' g/ O# _& P2 c
GROUP  customer_group.grb6 q( R4 ^4 _, Q( _3 ]7 R

, ^  `) `! L8 e; e% u# g- Z!  Example of a button that is placed directly on the Ribbon without being! R3 X( }' T! T
!  contained in a group.  This is a simple way to add a button to a tab
3 \0 X" k7 ]. R/ O; t6 t- u( m: a!  but is not recommended for many buttons since groups have advantages./ `2 u4 `5 o3 r# V2 ?
!  
6 P# t' @  b. j6 ?% i  M( m!  A few advantages of groups:. e1 C! D/ o: n6 }+ o% {
!     1. Easier to move many buttons around together in quick customization.  : @; R; Y0 s7 q% k- e
!        For example, MB3 on a group and choose "Add to Left Border Bar".  
( C% K) o% M5 f# Z) M0 r!        This will move the whole group to a new location.  If buttons are   F3 Z# R7 @5 R' D  i) L
!        not in a group, they need to be moved one at a time.2 H; z# ?3 k" Q5 G
!7 t& Q/ ]# T; w
!     2. Provide a label to describe its contents.9 b* C2 Y# p* ^
!* B8 ^) M- {; @9 s% Z
BUTTON CUSTOMER_BUTTON_1
, }2 r7 S; b$ ELABEL Button1 Directly on Tab. O7 j4 X: O& t# m7 u+ I) D

! d- b% O# N/ r' H; z2 X& Z* r9 l( r4 G$ T- c" F* ]! I6 D

* ~6 o6 X1 m. W! N" H: Acustomer_toolbar.tbr
0 T, r* f1 b2 ]( A5 m2 d!& v4 z5 h4 m* @  Y/ s
!  Customer Toolbar File
: k$ ~! F6 w2 A!9 u# r1 P! v# x
!  This is similar to an existing toolbar file containing
/ _1 c  W9 C+ k2 }!  no Ribbon changes.8 X2 E6 n- U% ^" F7 r1 i2 M+ I
!
* r' d7 E" m  C  ], B!  In Classic Toolbars mode - This toolbar will still show up in the * y$ N' R; Z2 L0 `& _' n
!     toolbars list.
' G* B( X! Z6 P" Q" G!
* y/ @. k' ?9 h! E!  In Ribbon mode - This toolbar will be automatically converted to a 9 W1 {4 r$ Y* U
!     Ribbon group and will appear in the "Classic Toolbars as Groups", ^' k# ?1 B/ s# T. u$ H
!     section in the Customize dialog." n: q' H8 Z* J& Y% I! i/ K
!  
0 c5 `8 K6 n2 u) q# ]3 T
# [0 A9 p! v5 G1 z% {. f' }TITLE Toolbar
2 D9 o- V7 b. XVERSION 1709 {% o  O: h; O( I% e3 L
2 G$ S, u9 Y/ l1 r( F7 B2 S
BUTTON CUSTOMER_BUTTON_11 X0 N9 `9 V. j2 E  u
9 @$ V' V- x1 M, ]- c, n' A
BUTTON CUSTOMER_BUTTON_2' ^; M' w9 h0 j: s9 \
7 ?, B) o$ _+ k
BUTTON CUSTOMER_BUTTON_3) b, O  y/ e: F1 j6 w

9 ?3 M5 J; f3 @. _; DBUTTON CUSTOMER_BUTTON_4# e% Z$ l, F& E# X$ d3 }
5 Z( ^5 w4 V4 h  A2 [) i9 [
BUTTON CUSTOMER_BUTTON_5
! f+ [! S9 W& l3 t; u5 k1 V6 k
3 G0 U( `+ w1 M9 Y5 h4 }3 P4 q( W: O8 P2 [; h2 M5 u

7 }* p" M' W9 s! X. ^! pcustomer_toolbar_alternate.tbr( N( G: m5 e8 Q$ E
!' |' X6 g. F) \) j3 [: s
!  Customer Toolbar File (Alternate)" {8 X2 w2 C% ?$ J
!
# ?) ]3 a3 N. B3 P!  This is similar to an existing toolbar file with new% j$ C9 X7 h( i( f, B5 U
!  Ribbon styles added.1 e' |' O+ v9 r  ^
!  : |# Y2 i% I) i) m/ Z. G0 m
!  The RIBBON_STYLE will be honored when the toolbar is loaded 8 k3 i* I/ |$ v2 b# r' m
!  in Ribbon mode as a group but will be ignored when the toolbar # `, F0 W+ R$ u4 T
!  is displayed in Classic Toolbars mode.
5 S* K& Y+ x1 ?  i% Z- W!) r/ q) ~5 ]) j7 J- |
!  In Classic Toolbars mode - This toolbar will still show up in the
0 e( l! Q8 n( g# I' M!     toolbars list.$ V! F4 ^, \) ~/ k  I
!8 U" a8 U8 Z, ^4 W; w  s
!  In Ribbon mode - This toolbar will be automatically converted to a
$ L- v* m1 d9 J) P( C!     Ribbon group and will appear in the "Classic Toolbars as Groups"
) \8 x$ f2 a4 Y6 K7 [) l!     section in the Customize dialog.
: }$ D6 M9 c4 [! w  W$ m. n!
0 L1 e; l5 J, w6 D. D% N/ j2 D+ C; n/ U  `  [! v$ x* }
TITLE Toolbar (Alternate)
: n3 q. Q- x$ B4 j9 ^VERSION 170( d8 _5 X, I& q8 k. B8 O+ W: r7 e9 g

; ^" x3 m4 I7 K2 |. f* ^# ^BUTTON CUSTOMER_BUTTON_1
) J+ x/ m, p% K) t- d6 qLABEL Toolbar(Alt) Button1
! p" Y, [- Q+ I* q) Y1 ^3 R( FRIBBON_STYLE LARGE_IMAGE
. q1 c7 R& R5 x* V
+ P; R! b8 i6 M, H$ Q! OBUTTON CUSTOMER_BUTTON_27 J- y. L1 E" j  S
LABEL Toolbar(Alt) Button2/ P, O- T$ Q8 r  ?
RIBBON_STYLE LARGE_IMAGE( ~3 H, G+ C# Y& B$ d

6 O3 R8 K; E* _% R  c$ n2 uBUTTON CUSTOMER_BUTTON_3
/ m) Y- J1 |  Y% J7 ~LABEL Toolbar(Alt) Button30 h/ b  Z0 R! k' r+ i
RIBBON_STYLE SMALL_IMAGE_AND_TEXT
8 P* Q, m9 e; j3 s" j3 R2 U4 i# O& I
BUTTON CUSTOMER_BUTTON_4
! J. j. R: ~7 A6 X8 y. WLABEL Toolbar(Alt) Button43 f+ }2 X. K8 {: X
RIBBON_STYLE SMALL_IMAGE_AND_TEXT. S' b6 Q8 K8 k
0 n; R' f4 y9 S& ?4 ~3 g2 v7 q! {. x" W6 o
BUTTON CUSTOMER_BUTTON_5
& o- w' C8 C" U6 s2 w! nLABEL Toolbar(Alt) Button53 f$ g; d7 @  H. K/ ]% a0 W
RIBBON_STYLE SMALL_IMAGE_AND_TEXT
* v, I1 A, ]% v6 a4 M7 i% S
9 a% L; ~2 f- ~# Z- B' B' A' ~2 R9 O9 I) T+ H
# \( y7 ~" |! f9 w2 v4 |0 J! x
customer_group.grb
& E& S+ h, g2 R% }3 l9 G!
" F3 |  a# t! t0 z7 h!  Customer Ribbon Group File
* a( W0 ~: L" l, _1 t4 R* O8 q!
7 g) b  P9 A/ U$ A7 s!  In Classic Toolbars mode - This group will be unavailable; M$ @  o8 [: ~8 M2 G0 M! x
!
* r# c6 Q0 X, A7 r  X( B!  In Ribbon mode - This group will show up in the "All Groups" list. l, I& N" _. J. F7 ?$ _( a
!     in the Customize dialog.
) c+ @& ?4 b0 P( D$ f+ r1 V!
  x8 q- i* |* C+ M! g$ B0 ~!  The labels of the buttons are defined using the RIBBON_LABEL token in the MEN files5 |0 @! B4 d1 r4 g8 O
!: P4 W" J* \2 }. d
7 x4 X. j  B# }4 d6 m* W1 |
TITLE Group7 M+ K/ j0 J* I5 Z
VERSION 170: r$ P" K( Y4 F; X1 K
+ h: f! E# j  Y# ?' X6 o% ~+ e* l
!  No LABEL defined, using RIBBON_LABEL defined in customer_men.men
5 c" @6 d$ D  ?7 m& w2 c. C3 `BUTTON CUSTOMER_BUTTON_15 @, T' y# E0 @3 r+ A; S' i9 ~
RIBBON_STYLE LARGE_IMAGE. H3 R/ q. U2 ?3 G1 ?2 ~7 f# i- n  l7 n
0 u5 y" M( P4 \8 C6 O
!  Example of a gallery defined in a GRB file.% W6 D) b& ?1 a& \7 [7 j0 Z% z. |
!
1 a! B" U1 w; k2 j( w( y* t!  If this gallery is to be used in other places, then it could be # T+ a" [6 L! ^1 u/ j& b' z% E
!  defined in its own gallery (GLY) file and referenced here# k; w9 s7 j( A, T/ P2 Z, d
!  Example:
( M; w, _, }2 t' Y2 s7 l7 c!    GALLERY customer_gallery.gly
# p: N( u( d2 B: E) v$ w- K$ @!
; U- l% V+ w, b1 l# hBEGIN_GALLERY  CUSTOMER_GALLERY$ O2 P( x( Y9 U
COLUMN_IN_RIBBON 2
8 Z1 s; I1 X  e1 _COLUMN_IN_POPUP 2
* ?, U6 m+ g# K9 ^  m! T1 U! f0 t- JLABEL Gallery
7 P% ?7 v' w* d. KGALLERY_STYLE MEDIUM_IMAGE_AND_TEXT
4 [6 x7 D7 L4 z  Z2 ~- f* u' q
! D3 B2 p4 S  c0 v    BUTTON CUSTOMER_BUTTON_2! Q8 m# F" U) b+ r9 k
% N5 p- z2 N) y% @2 W
    BUTTON CUSTOMER_BUTTON_3
2 K5 O* n" W( q& Q$ q
& `* N' @) W% B/ v/ d" c    BUTTON CUSTOMER_BUTTON_4
: C6 p# W( q9 C8 D  l
6 d- m8 N/ u3 a3 ?    BUTTON CUSTOMER_BUTTON_5/ N3 l* H5 {& y3 S8 x& h+ H3 x% Z$ K
# z* N0 q1 o- A/ [! l% M* H
END_GALLERY4 ?* c  M% U2 W* @; s
% b2 ?& ?0 m* J, y  |

! P' d, U: q% {
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了