PLM之家PLMHome-工业软件践行者

[资料分享] 关于NX二次开发 Ribbon菜单定义技巧

[复制链接]

2018-12-25 16:10:57 2316 0

admin 发表于 2018-12-25 16:10:57 |阅读模式

admin 楼主

2018-12-25 16:10:57

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

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

x
" H' ]: I* d5 E& t* Z0 x& T
/ t& N* v1 ?5 G2 N
( m, k& [0 ]+ w1 D
" X) B* v8 L+ Q, J8 T
首先认识下关于菜单的后缀文件
5 K/ k$ Z/ I, j4 V
# ^% o3 [, U+ ?( p
Extension
UI object
.tbr
Toolbar
.grb
Group
.gly
Gallery
.ddb
Drop-down
.rtb
Ribbon tab
.csb
Cascade
.abr
Attachment
' h# F3 P: d8 L! d, W

$ T' P1 I5 i7 e+ Q1 SRTB作为菜单ribbon 界面定义的关键,详细信息如下5 @4 @4 Z; i2 P- i8 f: F6 n# @

' C2 U7 E7 B1 y
. e1 [. R# `3 X2 rcustomer_ribbon_tab.rtb/ F8 [. ?  U& x" q2 [" M1 }  |
!
. p- A" |6 U: O; e!  Customer Ribbon Tab
  Y+ P; T# N" f- p! & b0 {- D5 t& D$ {0 Y3 o
!  This file will create a new customer tab containing three groups and
2 n) t, m& N( Y, k- R6 @+ c0 ?' |!  one top level button.2 P7 C, ^0 o& R- x6 I0 ]' J" }) g
!: M" q" a% M: g& S2 [% }, ^% H+ U

7 K7 \' L4 R# r2 Z) c/ q$ w/ LTITLE  Customer Tab
% }0 V- B. _9 x# X% @: k: t: YVERSION 1701 P# x: ~: }3 `0 i" l. O0 M
7 N% E1 j8 x, a2 s9 s
!  The first group represents a Ribbon group that references an existing : d) @: @$ P+ J0 u& ]# v  Z5 @
!  toolbar with no Ribbon style changes.  % v! P$ l( c$ C# n
! ' M. l9 s% r, X8 z+ Y4 r/ h
!  This is the quickest way to add existing toolbar content into Ribbon mode.
% Z1 u# m% _' B. P" y!
9 @5 f1 L+ g( n2 ?: o- ]; y1 _
GROUP  customer_toolbar.tbr, u7 u5 o( U. ?2 `. K1 O1 [0 x; x* Z
! 如果想直接切换tbr 到 rtb,这是最快的 % Q! V5 D& H) ]  W9 H. q8 S
!  The second group represents a Ribbon group that references an existing
7 p5 Q; a5 }1 L5 Q0 [$ D!  toolbar with Ribbon specific style changes added to it.  There is no difference% v7 `% l7 O7 b2 Q3 M% x$ n
!  in how this toolbar is referenced in the .rtb file compared to the first6 |2 L. k' k* P" Y: t5 y- y, c
!  toolbar as a group.  The only differences from the first group exist within
" `. B$ w% {1 v5 {5 @!  the .tbr file itself.
9 w4 p# Y2 a6 q2 L$ s/ r5 `; ?' N!
8 |. D; v4 }, |  U  d9 O- A!  This approach has advantages for customers that will deploy both Ribbon and1 \$ M/ B8 _! ?: Z  e% |
!  Classic Mode customizations since all the content is defined in the .tbr ' @5 P% q7 J! O; ]. m
!  file and it will stay synchronized in both modes.  Only one set of customizations
( _) H) w9 `4 j% y9 \, f!  will need to be maintained while still making use of RIBBON_STYLE to
7 [+ c1 q2 B& Q9 f: a!  control the presentation of the buttons on the Ribbon.
, r# y3 Z# t  u8 K% F!
$ }# b+ Y+ r& d8 d( tGROUP  customer_toolbar_alternate.tbr
# ^6 U+ m+ a& E( D
1 b, ]& _% p/ |7 N1 Z0 k" @/ F!  The third group represents a Ribbon group that has been created explicitly% m+ E+ U1 B1 a
!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the
7 h1 F* b7 J% q2 L# [!  preferred option since the user will be able to take advantage of all the 2 w: G, H( r6 `$ k0 w
!  layout styles and containers offered by the Ribbon.  
. I$ W3 Y7 y( M! a!
+ z* H% X( k9 P) r4 `/ Y. o* C4 q!  For customers that will deploy both Ribbon and Classic Mode customizations,
8 d) e. y. C  O" C!  this approach will result in no synchronization and two sets of customizations
( n# I7 L  l( _6 J$ N" ~' z; h! ?, w!  will need to be maintained.
! A( z5 m- M, v!
7 b0 a/ k' u- I9 ~" ~* `!  A group can alternatively be defined directly inside the .rtb file by using the
1 |, O6 {, ]  ^( c* R/ E4 X& O  @!  keywords BEGIN_GROUP and END_GROUP.  8 k3 U1 I; J# N* j" H9 G
!3 K, U- c4 u; {, G  @; T- f: U# ?
GROUP  customer_group.grb
- P, m5 p! l7 U7 L
  u( @/ p& d6 l: }, B1 s3 P: j!  Example of a button that is placed directly on the Ribbon without being. z; T% ~9 ^& p, \4 Q$ i, z
!  contained in a group.  This is a simple way to add a button to a tab; {; \6 x  ]. v% i8 S
!  but is not recommended for many buttons since groups have advantages.
2 [' M7 w! U+ V. W0 g! d. J!  
) k3 @" g+ S; }!  A few advantages of groups:/ u3 q% ]% E; C) v
!     1. Easier to move many buttons around together in quick customization.  ; b' x3 r2 G. u6 n. P5 `
!        For example, MB3 on a group and choose "Add to Left Border Bar".  
! K- T: X4 s9 N! V0 Q!        This will move the whole group to a new location.  If buttons are
7 {5 Y4 X1 Z& A- t6 L- U4 {!        not in a group, they need to be moved one at a time.
  i4 J! A) ?2 p  R( t8 r!- R+ ?! J+ v9 z; z
!     2. Provide a label to describe its contents.
+ Z6 a- D0 m" y; u/ q  {!
& Z0 j; Z8 }  V$ L, [BUTTON CUSTOMER_BUTTON_1! |6 @: }4 Z* p- I2 J' w
LABEL Button1 Directly on Tab
! z8 p5 u1 [- y/ K6 w% c4 f+ W

9 S8 v( z- V1 V4 a
部分菜单可以单独写成group gallery 作为对应后缀,重复调用- d5 |* r7 y! n( F4 E9 ^
!  Example of a gallery defined in a GRB file.
+ d9 \) I; H; A6 j3 x( ^!
5 K7 ~3 L" K9 Z1 V5 y# _) \!  If this gallery is to be used in other places, then it could be 6 z5 T0 ?  m5 _. f9 B: U5 s# g
!  defined in its own gallery (GLY) file and referenced here
2 K4 d' n$ M3 o!  Example:
& e* c! s0 N$ f3 H4 d!    GALLERY customer_gallery.gly
2 e2 c8 D8 e/ t( V' x!# Q" e! M; i( S" Y( n. c
BEGIN_GALLERY  CUSTOMER_GALLERY
8 c/ ?" F# m4 ^COLUMN_IN_RIBBON 2
7 b/ w0 ~; O4 f. z5 ^COLUMN_IN_POPUP 2
1 A1 U" Z" c8 \5 o0 T( C' s( jLABEL Gallery
) i6 K3 k5 m" m. y2 j! s% _GALLERY_STYLE MEDIUM_IMAGE_AND_TEXT2 o) j, j5 w1 Q5 u
6 _5 k# A: w  g/ ]# R, ]" S5 y
    BUTTON CUSTOMER_BUTTON_2; J* |, w  u% {5 N9 j
   
& U' F# ^6 X. V; Y5 W    BUTTON CUSTOMER_BUTTON_3
& b- G$ N, F9 f) y9 ^   
# h% s- U. _" @3 z( X3 o2 ]    BUTTON CUSTOMER_BUTTON_4) b2 D6 k8 i$ r: x  ~! v
    1 {' D. c6 |) }( q3 w6 i: y
    BUTTON CUSTOMER_BUTTON_5% m6 h9 b; ?/ O4 }& q- t
    * b8 t. ?" Y: M9 i$ D6 _
END_GALLERY* P5 W& W' `3 i2 m+ R0 s' X
9 h' n& y; H9 \' ^0 G0 I
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

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

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

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

    我知道了