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

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

admin 楼主

2015-1-9 10:37:48

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

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

x
关于NX二次开发,经典界面到RIbbon界面转换的菜单开发技巧# d6 @( [' D) f" a5 W

经典界面到RIbbon界面转换

经典界面到RIbbon界面转换

0 v6 |  C$ u/ X8 X1 p在经典界面下,需要的文件- r7 B/ r/ E. Z
  • customer_men.men
  • customer_toolbar.tbr* b' c6 @" P! C4 c0 r0 E: Y3 a
在ribbon界面下你可能需要的文件 : e( v: {* k; \9 h7 S, S
  • customer_men.men
  • customer_tab.rtb
  • customer_toolbar.tbr
  • customer_toolbar_alternate.tbr
  • customer_group.grb

    . X! w7 ~2 t( y8 d

; y7 O1 J! o- l; u1 D
, \: c8 i! w/ q9 h( n4 E举例如下:9 f! \+ @, ?& H7 S( k8 W  H
! `0 q( n0 J1 K5 u* |  {
) \6 O" \) j: j# q1 h* M; \9 S* u
customer_men.men
1 K7 u+ Q% h9 K7 n8 M, T; z3 L4 I0 u!
8 W; b! {* ?/ U* e4 e$ x1 I, q* W!  Customer menu file
# c" L& l2 h/ l7 [6 ^, c! M1 I6 S8 }! % w2 ~( F  Q$ z4 O% h4 Y
!  Contains button definitions to be used in 9 l" u" a1 \4 X
!  toolbars and Ribbon files+ s. [5 i& p2 b* E' m. g' o* j
!
) z4 u* j" j) Q- k  d% u9 c0 y1 R7 A5 p; F- d, K
VERSION 120
0 C$ S9 r& H2 L5 M, \& d
- f/ n1 Y! I8 _- u' l/ U7 O5 mEDIT UG_GATEWAY_MAIN_MENUBAR
- A; M+ {& E6 f& D& i+ H) v. l0 i% o( t3 C2 ?( [  j( [) s
TOP_MENU
0 `; ^) V! c3 S$ I, N. G    CASCADE_BUTTON CUSTOMER_MENU1 ~; |" M5 d( m0 ]9 \
    LABEL Customer Menu
# q3 c# J. R/ H/ Y' G4 Z& X6 z
) y! Q% v1 i) H4 b/ m+ X, ~END_OF_TOP_MENU
  r  P' [( n$ ~# T1 w1 z2 K3 H: v  k7 ^. c& [
MENU CUSTOMER_MENU
2 K0 g$ t& i8 T  o' z/ _+ \5 ~7 z+ y0 t
    BUTTON CUSTOMER_BUTTON_1
- `4 B/ v+ @, K2 A; T$ Q+ ?1 z+ b    LABEL Menu Button1
% ^* d0 S8 r' ^" n/ O4 b& t' Z         RIBBON_LABEL Ribbon Button1: p$ P/ E+ ~, N: S1 E
        TOOLBAR_LABEL Toolbar Button1
5 D, a8 o) Z# j2 h8 g    BITMAP fileopen' \/ c- P( q; n0 @/ _" y0 f  D
- e' u0 _  P& k( }: Q) X0 p
    BUTTON CUSTOMER_BUTTON_2
% d* v+ L4 R/ w' w    LABEL Menu Button2. ^3 u" X1 _9 r" X# l6 r
        RIBBON_LABEL Ribbon Button2+ I! k4 `9 r( D. i
        TOOLBAR_LABEL Toolbar Button2
( \0 D. ]/ N) r    BITMAP filesave
, S- ?% S; a& t. [. F) e6 P1 N" S* i& d/ {2 C
    BUTTON CUSTOMER_BUTTON_3
! x, H* r6 y( U1 m! S    LABEL Menu Button3
) ?, e: k0 e$ T, H* R  @/ {: y6 A        RIBBON_LABEL Ribbon Button3
, d* X& g' [3 o4 `- u, i/ _  s        TOOLBAR_LABEL Toolbar Button3- w- t+ K( ~8 ^, ~5 }* k# ?) \2 u
    BITMAP current_feature6 o' Y8 {# B9 F* z' \

$ Y1 V* H( f4 `3 {2 j: Y* `: W    BUTTON CUSTOMER_BUTTON_4
  I# C9 d8 g) l$ a8 d. G    LABEL Menu Button4
$ v8 @2 J# A* H/ w        RIBBON_LABEL Ribbon Button4
: ]* D& m+ U4 {. \" z) w8 s" ~        TOOLBAR_LABEL Toolbar Button4- N  q7 t" H9 v7 K" @
    BITMAP block
+ i0 H. `4 ~/ d- Q  @# y' C& r; p* J$ |+ ~! v: e
    BUTTON CUSTOMER_BUTTON_5/ d& r+ h- H# V) U
    LABEL Menu Button57 C7 m0 |  l1 o( Z7 P8 {- H
        RIBBON_LABEL Ribbon Button5; m" o0 R7 A* x- d; |( t. {
        TOOLBAR_LABEL Toolbar Button5
1 N5 f, a4 O/ n& z    BITMAP checkgreen# f$ u2 t. `5 ]  S9 d# {" T( u

& R( B% K# _" G: Z( ~END_OF_MENU' D6 {# D( ^4 t$ O. r
/ `6 b% f1 ^1 E0 G0 k# v
2 T5 r  D, Z$ Y1 F% l/ s
- \6 x) D4 z/ ?: V2 }
customer_ribbon_tab.rtb/ N* I3 `1 W/ k7 b
!& k5 s, Q5 v* M' Z4 Q
!  Customer Ribbon Tab
' f# Q" n6 a& h( Y9 ?) k* }0 W1 n! : r: _' y! I% M0 b5 H0 F
!  This file will create a new customer tab containing three groups and
' D; H. ^& G2 G  m" z: Y!  one top level button.: f: ]6 a- ]5 S, R
!
6 ^. z/ ^- Q* G& d$ S! h! S
) h. y5 Z& r2 [7 q. n+ hTITLE  Customer Tab) w0 h3 u, V7 L% w
VERSION 170. \0 W- B. m3 G5 F6 q5 o

# a+ Z0 `) P% ~' R3 \!  The first group represents a Ribbon group that references an existing
1 [0 `4 p6 }/ x/ j% \. W!  toolbar with no Ribbon style changes.  8 S  ^! H3 r3 [5 m$ Z- R1 z  p1 a
! ; L: ^2 L3 D+ n6 f8 g) G
!  This is the quickest way to add existing toolbar content into Ribbon mode.
" ~3 X* i! I  n2 `!2 O( s" b! Q( U5 V  N) ]) L3 l! Q
GROUP  customer_toolbar.tbr
3 [% P5 L1 q0 e. ?, d! D
* {+ L+ f  m; K, y) s) ^  C!  The second group represents a Ribbon group that references an existing 3 G7 U. v; F; T- Q% B" ^7 S3 M3 o
!  toolbar with Ribbon specific style changes added to it.  There is no difference7 l; R1 _& j8 f$ A* O5 @" |
!  in how this toolbar is referenced in the .rtb file compared to the first
4 y* d: ~# r1 r/ C0 q- B5 z  A: m+ X!  toolbar as a group.  The only differences from the first group exist within ' z8 i6 n+ @5 q2 _5 h$ d! m/ V3 L
!  the .tbr file itself.
; S. Q4 Y$ b9 T; `. M2 l!
: j* y- |" y( a!  This approach has advantages for customers that will deploy both Ribbon and( _# H; ~  [6 B' _
!  Classic Mode customizations since all the content is defined in the .tbr
4 j% n  j" P0 _% |8 b' L* j) U3 ^, R8 r!  file and it will stay synchronized in both modes.  Only one set of customizations5 ?5 R2 [4 Z6 c6 g- i
!  will need to be maintained while still making use of RIBBON_STYLE to
/ ^3 o7 \. I  d6 F- \2 d+ D!  control the presentation of the buttons on the Ribbon.8 U% U* c2 s+ Y4 k$ M# V
!
2 `$ \; [8 u6 Z- E1 E8 b0 iGROUP  customer_toolbar_alternate.tbr0 Y6 n2 @# V% M

& p7 h8 n9 \9 C9 [!  The third group represents a Ribbon group that has been created explicitly
% V' U7 x3 K( {9 D0 B. n!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the, e3 d* ~( K2 V+ Z) ]& n
!  preferred option since the user will be able to take advantage of all the / x8 X0 {+ s# q5 \1 i
!  layout styles and containers offered by the Ribbon.  
7 Q9 d# N" t& Y! c* G; s! ~* L5 o!
3 Q6 \0 L2 W3 g- x& i  b7 D5 E!  For customers that will deploy both Ribbon and Classic Mode customizations,
' K; F  N/ y4 _" o. @! q!  this approach will result in no synchronization and two sets of customizations
" M, G& H; I& B( f: x# r4 J!  will need to be maintained.
# Y! U! X0 i8 c!
! q0 L1 o4 F1 s' _% g!  A group can alternatively be defined directly inside the .rtb file by using the
# l- W: b1 M  I4 O. f/ f!  keywords BEGIN_GROUP and END_GROUP.  6 O0 \. g# ]# z6 y/ m$ q8 E# p/ \$ X" M
!4 l9 J: d8 f3 h; a# e3 N
GROUP  customer_group.grb: m1 ^# c# j5 j3 m$ d& ^
5 U' o6 I& }8 l; O! A# j
!  Example of a button that is placed directly on the Ribbon without being2 H0 q% _+ _8 n2 z
!  contained in a group.  This is a simple way to add a button to a tab) E1 R; i! P3 S0 \( |0 k& g
!  but is not recommended for many buttons since groups have advantages.
  w6 ], z( u- i!  
& ^0 K7 g* T; K! Z% u/ v! D!  A few advantages of groups:
; z. p5 t" t$ ^% p!     1. Easier to move many buttons around together in quick customization.  8 q) |* a. u. B9 u
!        For example, MB3 on a group and choose "Add to Left Border Bar".  " v: }. u9 H% B' r5 ^: d
!        This will move the whole group to a new location.  If buttons are
* z/ m) F3 Q3 x* H!        not in a group, they need to be moved one at a time.9 e! X, V0 w  b3 y9 q/ h$ o+ a
!# j8 B: J! ^8 c7 M  Z# P
!     2. Provide a label to describe its contents.) I2 c  n. ^: t5 S1 @
!
# }' m6 S, T5 H  EBUTTON CUSTOMER_BUTTON_1
( Q9 l. N4 P. `. }# [- VLABEL Button1 Directly on Tab
& s1 B6 s6 p5 Z3 q1 q5 A7 `- }! r4 R# I2 o. R- T: X5 }" K
0 P6 o3 I0 p' Z4 ^1 i, g2 }( Q' [
( \- U6 L1 u* `
customer_toolbar.tbr; `1 V: m# }% x( i* l! X5 x
!% j% w9 G2 z( D+ x% p- p
!  Customer Toolbar File' i+ }5 `$ f; ~7 W0 s
!
2 S6 h0 f3 Y, C2 P6 n!  This is similar to an existing toolbar file containing+ {% M) [5 O  C9 L7 O" E
!  no Ribbon changes.
. b" G2 W1 y- g# }- L!
+ l  v6 a5 P2 H& j2 X  R!  In Classic Toolbars mode - This toolbar will still show up in the
1 r( }" N! r( E!     toolbars list.
; w. U; I* q3 I* k) o& Q!
+ v) A; T1 J/ f!  In Ribbon mode - This toolbar will be automatically converted to a - @$ w( G$ @/ ?
!     Ribbon group and will appear in the "Classic Toolbars as Groups"* v9 u/ B0 v4 p
!     section in the Customize dialog.
+ Y. Y& z3 Y: o3 s' j' @. L!  
4 D' {5 N) V7 e0 b0 m
4 M- t) j- I/ L" vTITLE Toolbar
. }( [3 _' e0 z# K. U+ YVERSION 170# r5 @* \7 c4 B2 t

! `2 S# r) C# d3 sBUTTON CUSTOMER_BUTTON_1
! v" c3 D8 L: P) [* b) ]" D* Y2 t- ?, C- R1 P" s, J/ N
BUTTON CUSTOMER_BUTTON_2
! G" O) y; q" e6 E3 i4 f6 d- p/ i2 v3 }
BUTTON CUSTOMER_BUTTON_3
% Z& b9 u, L/ i; A# _2 g! C2 k) T0 j" j6 b9 A
BUTTON CUSTOMER_BUTTON_4
! k8 A. Q+ l0 B
. z  G; _- }/ f5 W4 E; vBUTTON CUSTOMER_BUTTON_5
# Z& U( b: D$ I5 [; i
5 {# I% q  N+ N0 E9 H! n# w7 t
! [( D2 w* }7 ^3 ~! d* V$ |: \6 B: ~0 F" Q, k- O4 s0 w: X
customer_toolbar_alternate.tbr
3 N* }& l$ Y6 [!
! S: u7 _! [* B: Z$ q, z7 M!  Customer Toolbar File (Alternate)
. q# ]9 h+ X9 Z+ W2 r!
( b* M& _( y! L* Q& q5 j!  This is similar to an existing toolbar file with new
) p% r; m7 i7 N" {+ v!  Ribbon styles added.
' A* T3 G1 [, U, L2 X  L!  
' ^6 {+ \5 Z! O# j( K!  The RIBBON_STYLE will be honored when the toolbar is loaded & u; I+ v# M, d' E
!  in Ribbon mode as a group but will be ignored when the toolbar 7 L: _% u& p* q" G
!  is displayed in Classic Toolbars mode.
, e5 B" T3 X& D$ X1 H% S!) E' {! R% }1 a. I/ H8 ^2 [$ _
!  In Classic Toolbars mode - This toolbar will still show up in the : }: g! p4 E/ G6 }) M
!     toolbars list.  g" s7 c2 R' u9 h4 A/ j
!1 o: i1 F+ l' H
!  In Ribbon mode - This toolbar will be automatically converted to a
4 P3 Q# I& G+ [4 _1 `& Q$ a& I- Q!     Ribbon group and will appear in the "Classic Toolbars as Groups", m1 i% W2 H$ G8 _8 f
!     section in the Customize dialog.  d: h2 [7 ]3 ]$ f
!* N3 s9 v) Q8 [( E4 n4 Z" Y4 u# G

) M& h. ~! j, I8 V& T( k: Q: m; dTITLE Toolbar (Alternate)! z$ `# W0 W0 a2 |
VERSION 170
& P, d. ^8 _, W4 \: \( L& u
$ O& Y* Z: H: o% D/ V6 e# xBUTTON CUSTOMER_BUTTON_12 K: y1 h) b! j( C( z  T. Q+ ~
LABEL Toolbar(Alt) Button1  P. K! R" s! g; i/ Q) A
RIBBON_STYLE LARGE_IMAGE
1 J: j. D+ E! E! v% o
8 T/ O) Y# l3 [3 S7 n* G' j9 |) V6 d) yBUTTON CUSTOMER_BUTTON_2
% d. f5 }2 ?, S7 u% s' DLABEL Toolbar(Alt) Button2
* Q/ }& n. \% \6 C4 X) k' _0 MRIBBON_STYLE LARGE_IMAGE& e# S& [  C" R8 @- ]! D- B& W* j, o

: B$ O  s8 z9 h$ m. \  [5 HBUTTON CUSTOMER_BUTTON_3
8 c" Q2 f7 L, E9 E  Z& w) gLABEL Toolbar(Alt) Button3, p* X$ e. Y% Q
RIBBON_STYLE SMALL_IMAGE_AND_TEXT
, {) K  F6 r: r
4 B( ^$ _) w, ?5 r# T( zBUTTON CUSTOMER_BUTTON_4
# x5 ^/ q( n, s/ DLABEL Toolbar(Alt) Button4. E( _1 _; p, D8 n
RIBBON_STYLE SMALL_IMAGE_AND_TEXT/ w$ O/ }0 B' h' [# ^! W

% i3 F2 }$ E: r. FBUTTON CUSTOMER_BUTTON_5
8 [* n3 N- v9 F  F6 Y% w! cLABEL Toolbar(Alt) Button5, A% e+ d+ R3 X5 p
RIBBON_STYLE SMALL_IMAGE_AND_TEXT* S9 e. X  x$ ^3 U, k8 a
! `: N* y' R8 q! \

: ^6 {% I2 U3 i5 ~1 ?
$ U4 R# F. t( O( W  ]9 _+ vcustomer_group.grb
! U- ~5 p; A# C2 M4 `!
4 E9 M7 G. ~2 p/ h* B! P; f8 ]( Q! ?!  Customer Ribbon Group File
- H1 o+ }, d: J) L' ?!
  w1 I3 z' l# Z& C% b!  In Classic Toolbars mode - This group will be unavailable) C& j/ j8 K9 ]) z8 S0 v) K; W( F
!
) D* W' W: d4 z- m4 |) @& _!  In Ribbon mode - This group will show up in the "All Groups" list- c3 l6 i' M" D9 O- Q% E! E. A
!     in the Customize dialog.: e/ W# t/ L. C. W
!
- W5 t/ D* `9 t0 K, r!  The labels of the buttons are defined using the RIBBON_LABEL token in the MEN files
5 g% B4 `$ `1 W, o' @  J!
5 R+ ^4 I; J1 W  P) w* i7 r' U7 G0 T
TITLE Group
% e' `! H2 ~9 V( U) N" uVERSION 170
, t7 E5 j0 L# v( ?  E' }6 ^; H* G) g/ c. ]9 `" H) }
!  No LABEL defined, using RIBBON_LABEL defined in customer_men.men0 _$ z+ B2 j5 H  Q0 P( i/ i. y
BUTTON CUSTOMER_BUTTON_1
( Y0 T2 M4 d1 _RIBBON_STYLE LARGE_IMAGE
. k2 w+ W8 b4 [5 s( a! U* ]% X6 ^! B  X9 g% g* A7 K6 f
!  Example of a gallery defined in a GRB file.1 o" f) n* q8 E! k/ W4 J
!
% [4 B1 x8 k$ [. c4 g!  If this gallery is to be used in other places, then it could be 4 K8 Z" n' L* w- N
!  defined in its own gallery (GLY) file and referenced here
- Y: d0 j$ a& p% ]7 J$ R!  Example:4 V* X' y( k# P# b! E& L/ k7 k
!    GALLERY customer_gallery.gly
/ g2 S! @. i# b0 d!9 ?, X/ {" ~9 N; ~* t3 H! j
BEGIN_GALLERY  CUSTOMER_GALLERY* {$ G9 X% o5 b; V+ A# j
COLUMN_IN_RIBBON 2
) y7 U4 o3 s, VCOLUMN_IN_POPUP 2
4 d3 Z: G" }+ P5 b' M" H5 E7 R' bLABEL Gallery
( p" F% l, O$ {5 {) tGALLERY_STYLE MEDIUM_IMAGE_AND_TEXT
; e8 r. ^4 Y7 D# S0 E) D. l; L6 _5 }; y; d+ T. w) j
    BUTTON CUSTOMER_BUTTON_26 G+ r1 A; Y6 B; t2 U2 l% D
% M2 k! y+ s4 H; ?- y
    BUTTON CUSTOMER_BUTTON_35 U1 M" ~# O( T; c( z
( C9 v; s1 z) R+ m% O
    BUTTON CUSTOMER_BUTTON_40 D7 w* Q4 R( A2 T- j
7 O, R# M8 s6 A( y
    BUTTON CUSTOMER_BUTTON_5  A* [5 O  ~9 d/ y% J5 t. i" S
$ C0 b$ M# w' S2 S2 j' N4 e. y
END_GALLERY
0 {' e7 {& l. Q+ K- Z0 D7 M/ S, r

4 Y* W, M. ~5 F4 G8 V
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了