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

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

[复制链接]

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

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

admin 楼主

2018-12-25 16:10:57

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

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

x
) G4 P& s/ w/ a, H7 n5 J4 c
5 X* P% U2 F& o2 _

0 I5 g. J, b4 P
( L# `) o" C5 s5 }& z' C! @首先认识下关于菜单的后缀文件$ h& s& t  d& c0 d  e

1 b" s( N! I, D0 R
Extension
UI object
.tbr
Toolbar
.grb
Group
.gly
Gallery
.ddb
Drop-down
.rtb
Ribbon tab
.csb
Cascade
.abr
Attachment
4 K4 S6 @2 p% V+ I* O  ]$ g

+ g: X& y4 h5 u, N" eRTB作为菜单ribbon 界面定义的关键,详细信息如下* z& B7 @; n4 K( M
  X3 }+ a% [! P% v5 h! H

$ P. j. X4 ~3 {% {* b" Xcustomer_ribbon_tab.rtb# z+ d5 I" m4 i
!
9 N- f& `' v( V# K!  Customer Ribbon Tab5 B, v1 g$ q) g3 g& }
!
9 s3 {9 S: e: ^  Z* D!  This file will create a new customer tab containing three groups and1 p7 p+ Q2 ~( `* ?7 A. |3 z7 r
!  one top level button.4 q  D7 J6 w8 M+ |+ J
!1 A9 M3 G- C3 ^
5 s) I( G+ N( I4 [+ V4 {. N
TITLE  Customer Tab
: g* w, N- r% a* _# D% dVERSION 170+ h- }0 ^6 P# }& k0 }

7 ~$ b3 r. f7 R!  The first group represents a Ribbon group that references an existing
/ b* s3 T) n1 C!  toolbar with no Ribbon style changes.  
7 j- z) Q# N1 e6 Q( v" s$ Q' p! 5 M4 J0 A# ~1 o( B
!  This is the quickest way to add existing toolbar content into Ribbon mode.
9 L' `9 y" |- k!
- m- [; K$ G+ t7 d; g
GROUP  customer_toolbar.tbr
9 R3 E; n" H5 M
! 如果想直接切换tbr 到 rtb,这是最快的
' m$ g, b9 {2 Y5 F!  The second group represents a Ribbon group that references an existing
) G, ~- k) [) ?1 t+ l!  toolbar with Ribbon specific style changes added to it.  There is no difference  X4 y% ]# z, |" k
!  in how this toolbar is referenced in the .rtb file compared to the first' b: P( T, J% r' ?& v  h
!  toolbar as a group.  The only differences from the first group exist within
5 [4 Y3 c4 C$ d; P0 A% O!  the .tbr file itself.
- `9 Q! Q0 \: M' a0 C' r$ i!
2 j+ u+ {9 S8 B/ V! J- O# B!  This approach has advantages for customers that will deploy both Ribbon and
9 Z% L: a. U% R!  Classic Mode customizations since all the content is defined in the .tbr
1 J3 A( C4 |6 [* R" Z  _!  file and it will stay synchronized in both modes.  Only one set of customizations4 W( t! }" t% `* {
!  will need to be maintained while still making use of RIBBON_STYLE to , w& F4 g; L+ k! R$ Q
!  control the presentation of the buttons on the Ribbon.
0 A$ G" k2 ]; N$ Z( [. v!
3 [6 _9 \  i* ?GROUP  customer_toolbar_alternate.tbr
+ a) ~+ D' ~+ X" P; g
  {2 P0 j. D$ E! |/ G8 ?; N1 ?!  The third group represents a Ribbon group that has been created explicitly
; b1 m; A  D) f3 s/ g1 A8 I!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the. G8 H/ n* z: u/ R1 C# K$ ^
!  preferred option since the user will be able to take advantage of all the 0 H- f9 j' ~: ?$ D; f9 X' H
!  layout styles and containers offered by the Ribbon.  ! f4 C) h0 C4 y9 o7 x7 T
!
4 t9 v, t1 ^4 }!  For customers that will deploy both Ribbon and Classic Mode customizations,
% S! H/ q6 t- W1 z- Z3 D/ x!  this approach will result in no synchronization and two sets of customizations ' \. }* A( s6 I; a3 |# m7 p
!  will need to be maintained.
% _5 I4 d% w: ]!
# x" Z  X* o6 Y9 s!  A group can alternatively be defined directly inside the .rtb file by using the& b1 j$ i5 V+ i8 ~# d! T  J6 c7 k
!  keywords BEGIN_GROUP and END_GROUP.  - E) i" d. X8 K9 m4 o$ G- n/ B: k
!
* w& x% C5 J- Y+ y1 \; jGROUP  customer_group.grb$ i, m  s" [, C& a
# I( }% E  j" x- {
!  Example of a button that is placed directly on the Ribbon without being
: o0 i2 {# r$ h8 N  p; t!  contained in a group.  This is a simple way to add a button to a tab2 T' a* I2 J. ?
!  but is not recommended for many buttons since groups have advantages.
4 @% c* Z9 o' `, V!  
. ?) `6 @' R7 f3 G!  A few advantages of groups:) K* L& F, V, o2 ^) q% A9 F1 d# ~9 O4 H/ z
!     1. Easier to move many buttons around together in quick customization.  : u" i% U4 z7 ^* ~' B2 F; Y( \
!        For example, MB3 on a group and choose "Add to Left Border Bar".  2 m" L, Y3 L1 T* O% M* C
!        This will move the whole group to a new location.  If buttons are
4 t% a' ~% Z& e!        not in a group, they need to be moved one at a time.* q0 V7 {# w4 e* j$ }
!
  |7 ]1 K7 [0 ], D# \!     2. Provide a label to describe its contents.
& ?" Q" K& J$ s% y% s!
1 N' G% t% [- rBUTTON CUSTOMER_BUTTON_1
. o. \  r( [, v- ]! L' t  t, ?6 ILABEL Button1 Directly on Tab

, Y  [5 t% j# a

' J* Y5 I, y0 O* C$ s; a+ g  e
部分菜单可以单独写成group gallery 作为对应后缀,重复调用
9 Q. f$ \! _( i9 s!  Example of a gallery defined in a GRB file.
  O. Q+ Z+ r5 I; p7 E% r/ u!
+ j$ c' b3 k4 w& ]' v!  If this gallery is to be used in other places, then it could be ) y  O; G. c* ^& B
!  defined in its own gallery (GLY) file and referenced here
$ ?. J0 V6 q! y# T!  Example:/ L7 ~- g. Q! T0 |8 y% y. k) s5 t
!    GALLERY customer_gallery.gly! G# L) N; `/ r+ {. ^1 @
!
8 T- M& M7 @2 fBEGIN_GALLERY  CUSTOMER_GALLERY# H9 U% n" e1 F+ d- d/ `
COLUMN_IN_RIBBON 29 b% s- ~  V& {: O6 ^5 {8 `$ d+ c# V
COLUMN_IN_POPUP 2
: X1 h% c5 F8 [1 gLABEL Gallery
5 c7 L  p, J  }" y) a! RGALLERY_STYLE MEDIUM_IMAGE_AND_TEXT! r1 S8 I) }& Q& H* X, G
1 ?: A" c$ y* O, p* t, v
    BUTTON CUSTOMER_BUTTON_2; h4 Z2 x0 R, ?; I( h: ~! F
    8 ?3 Y, `5 M# f3 u, ^9 W
    BUTTON CUSTOMER_BUTTON_37 ~. f, v7 g1 Y
   
& {# l  F8 \# w9 {0 d    BUTTON CUSTOMER_BUTTON_48 R+ y& J+ i# L3 M- F
    3 u' h$ P+ @  L( x  L7 f0 I
    BUTTON CUSTOMER_BUTTON_5
" b4 s5 N$ e+ u* V# `9 j/ G   
8 |6 c2 U. a/ `2 O7 J: @1 qEND_GALLERY1 q1 `* S- D5 g
! `  {- c. Z! O) l
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了