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

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

[复制链接]

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

2470

主题

1275

回帖

8万

积分

管理员

PLM之家站长

积分
82170
QQ
发表于 2018-12-25 16:10:57 | 显示全部楼层 |阅读模式

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

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

x

2 {" Y+ ~: o0 _7 |) l5 A9 k8 W7 G  Y( X0 s$ I4 I. p

% u; j$ K  J% v) D. C
1 W1 x- t* _- W, K) [  m首先认识下关于菜单的后缀文件& u/ U7 O- S- v( ?, X5 E

! E  z  H1 c+ X' _' q; k
Extension
UI object
.tbr
Toolbar
.grb
Group
.gly
Gallery
.ddb
Drop-down
.rtb
Ribbon tab
.csb
Cascade
.abr
Attachment
7 m: k: x0 Z) I& |" m2 L3 f# c

1 z8 e- g5 M- K6 i( j. k/ w$ ]  IRTB作为菜单ribbon 界面定义的关键,详细信息如下
7 }; j( C9 l, {% x; v
$ J0 x5 M# N1 _) a6 s$ X6 m- C5 W8 o* q! H
customer_ribbon_tab.rtb
/ n9 ]& u$ h3 K: n+ e+ u( C. w!! n0 b3 z  ?! M1 S* t# x
!  Customer Ribbon Tab
* s" \& b- N" e8 m+ M% B4 }!
8 P, i! @3 Y$ [9 D+ v' Y- f% ]!  This file will create a new customer tab containing three groups and
7 T" t, a) V, q0 b!  one top level button.  l4 h4 @5 F' V3 E+ z
!
, B, _3 f  A: q7 M9 |. L7 I
8 H7 p* t! U+ }: p( ~$ c& dTITLE  Customer Tab
2 L% A( a* l' g: B3 cVERSION 170# C; ~0 ]. P! S+ l/ q
! ~! S: k1 P( w6 L4 O
!  The first group represents a Ribbon group that references an existing ! }5 `; @  f# k0 `; |
!  toolbar with no Ribbon style changes.  
% d! C0 k6 e% I/ u( D9 R4 z" U( o!
4 o4 `% J0 o4 A1 R; Z!  This is the quickest way to add existing toolbar content into Ribbon mode.
% ?- A) o( ]& D; b9 r4 K!6 H0 a! S- Y9 ^
GROUP  customer_toolbar.tbr
5 ~5 Y1 H* b, l* c' O
! 如果想直接切换tbr 到 rtb,这是最快的
6 y2 R7 b% m. D6 g' n# N: d!  The second group represents a Ribbon group that references an existing
8 y: W( `4 M" X1 c; h. y!  toolbar with Ribbon specific style changes added to it.  There is no difference/ P1 y* X5 }- T7 z) V$ i7 u
!  in how this toolbar is referenced in the .rtb file compared to the first
8 L& }2 t2 K, E; v0 c!  toolbar as a group.  The only differences from the first group exist within
* {, l+ ~4 h' s5 b( {!  the .tbr file itself.% t) ], U+ g9 x1 F- c% g6 _
!
, Z0 ^0 E1 u  t2 r!  This approach has advantages for customers that will deploy both Ribbon and
8 U) G" E7 w' }5 y) c0 d$ }& j!  Classic Mode customizations since all the content is defined in the .tbr
; N8 c% |) {# ^/ ?1 E0 u# n9 R1 J# V!  file and it will stay synchronized in both modes.  Only one set of customizations
( o' I" J2 \0 J! G5 M, Q8 p!  will need to be maintained while still making use of RIBBON_STYLE to % Q2 t' j: M9 T! @# f
!  control the presentation of the buttons on the Ribbon.5 x4 j0 f: z% [7 J0 A! G) ^
!
* B' \6 M3 U8 z7 I; TGROUP  customer_toolbar_alternate.tbr1 N$ o0 R# h. }( o2 T
- X0 \  j5 W6 U8 r
!  The third group represents a Ribbon group that has been created explicitly) i. P' @% D( l0 |) |
!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the
* y4 u' o( |( E$ F; P! N!  preferred option since the user will be able to take advantage of all the . R& J6 ?7 v9 u% b  }9 B+ F
!  layout styles and containers offered by the Ribbon.  & i4 R: O5 i+ d. A
!' w/ x( ?% K6 Z7 h! f
!  For customers that will deploy both Ribbon and Classic Mode customizations, # ?4 H' M7 K# `* E0 K% c& y& Y% S
!  this approach will result in no synchronization and two sets of customizations : l. Z8 D: r2 E& w6 h
!  will need to be maintained.. F. O6 k, n9 ^
!! H9 k, s9 z! T# E1 ~) \# G
!  A group can alternatively be defined directly inside the .rtb file by using the$ l0 @0 H; }! w! ~) ]
!  keywords BEGIN_GROUP and END_GROUP.  
' E6 }2 ^1 Y' @* S!" k) t' ]. m, B; ~1 i* }- G5 |
GROUP  customer_group.grb& d$ I4 a6 g/ Y$ c

) ^: ~3 W1 @0 }7 p!  Example of a button that is placed directly on the Ribbon without being
2 @1 c; D# R% `5 D!  contained in a group.  This is a simple way to add a button to a tab  \8 j( `! o* y9 K. c
!  but is not recommended for many buttons since groups have advantages.
$ ^0 Y  h" V4 \! b) j: K!  
2 k6 M9 _: ~8 O! R$ k, U!  A few advantages of groups:
- f% \0 M/ I) }  U5 }0 V8 ^* I!     1. Easier to move many buttons around together in quick customization.  / f9 m  P8 N$ V) [/ U# a
!        For example, MB3 on a group and choose "Add to Left Border Bar".  / a1 ~) W9 g* e$ T. w! [  {6 N% W
!        This will move the whole group to a new location.  If buttons are
9 [  R' w+ \" y!        not in a group, they need to be moved one at a time.8 k5 n; o& B. a' a3 g
!
+ v) ^1 `' n* e. G!     2. Provide a label to describe its contents.
: r6 g% d$ ]) d0 @0 [!
/ R- L  K5 N7 O' D! n- p' }+ KBUTTON CUSTOMER_BUTTON_1
! L9 K& ^% I# _  e% G6 n7 W, HLABEL Button1 Directly on Tab

' c; @6 [) o: ?! F" T0 o

1 Z* x7 v- q, r" Y$ `
部分菜单可以单独写成group gallery 作为对应后缀,重复调用; o! E0 f  l( `; k4 C/ K& F& K
!  Example of a gallery defined in a GRB file.* e$ h. w7 S$ E+ a& C" U
!
: E: Y* S. ~- Z# U1 L3 d" Y  N1 @!  If this gallery is to be used in other places, then it could be 5 i. e, ~" [1 Y$ N1 ?4 I2 k0 L
!  defined in its own gallery (GLY) file and referenced here1 k3 q+ T2 q! j4 D
!  Example:
9 M, X$ a  M' b, p6 U( k) k) Y3 @0 _!    GALLERY customer_gallery.gly: T6 `: k+ J8 N
!4 e2 w/ ^, H( l" b
BEGIN_GALLERY  CUSTOMER_GALLERY$ Q! Y3 {8 }8 o8 d/ n
COLUMN_IN_RIBBON 2# F  W  W7 o' i/ C- I
COLUMN_IN_POPUP 2( v* {" I! X# A/ v$ D
LABEL Gallery8 D" `9 ~9 O* O/ M
GALLERY_STYLE MEDIUM_IMAGE_AND_TEXT
/ H# F3 X# e! Z, }  s- E* V2 r7 y1 V
    BUTTON CUSTOMER_BUTTON_2
5 M( }, f. T. K1 F0 u; [7 j5 S; n   
6 p. b! _& h  C2 u& r: T# q+ u7 F    BUTTON CUSTOMER_BUTTON_36 o* @' s4 [$ e% h% Y  E( }
   
- u; S, G' n* i/ m2 D3 t' B: r! l    BUTTON CUSTOMER_BUTTON_4
3 s7 v2 L- p) ^; O* _    & v7 k8 @, o- ]( o1 c  K2 _
    BUTTON CUSTOMER_BUTTON_5
! d& @1 l% _% ~4 `8 H   
/ g2 [3 `, j# u  V. Y6 ~END_GALLERY$ j- H# y* N1 m5 W$ S

5 \+ Z# k7 }0 ~' A2 A6 Q6 j8 e5 _+ u
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了