PLM之家PLMHome-国产软件践行者

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

[复制链接]

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

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

admin 楼主

2018-12-25 16:10:57

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

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

x
' r6 _% R) A* t+ m' `. _
4 \' n. z) F+ B' T: B" z, L$ t$ z
8 B' P5 l# @4 B5 }, N5 D

* `  e; l! p1 \0 Z首先认识下关于菜单的后缀文件& z8 M& q3 p$ u: A

2 g5 o0 S- G5 D& W, M, Y
Extension
UI object
.tbr
Toolbar
.grb
Group
.gly
Gallery
.ddb
Drop-down
.rtb
Ribbon tab
.csb
Cascade
.abr
Attachment
; B; ^, I( Q- o& a: _

4 e5 \$ J6 V! SRTB作为菜单ribbon 界面定义的关键,详细信息如下/ b8 z  D1 b9 L# v3 q- ^4 K

; w+ h  b5 F- y0 e. P* ~* A3 u: |3 p# {( O3 K' r7 E
customer_ribbon_tab.rtb9 R9 F& D2 m( S* {" }/ C
!
6 S6 j7 I1 w$ u!  Customer Ribbon Tab
2 a5 g% f6 X$ `, E3 E  o! , w1 {5 J8 p- T$ B0 {
!  This file will create a new customer tab containing three groups and9 T# b" L) n6 N% ~% M
!  one top level button.; g' Y! [: a& ~5 c% r
!
! }7 @' B( c1 D! h+ k/ v  ]
% o) e6 N) c" S$ m3 t+ GTITLE  Customer Tab5 g& p' o' z  Z1 q% |; N$ {
VERSION 170# h1 l& Q% ?& x
2 C) ]: w$ O# B$ o8 h( `
!  The first group represents a Ribbon group that references an existing
4 Y; O" s  m7 Q4 {" B!  toolbar with no Ribbon style changes.  ( G! |7 m2 `+ [) J
! " h8 G" T8 m/ I  Q' O
!  This is the quickest way to add existing toolbar content into Ribbon mode.
' `  R7 ^; U* X6 v!
, u  g8 Y, w: V+ q# j+ G- v
GROUP  customer_toolbar.tbr9 V5 |) X0 t1 A) x' s
! 如果想直接切换tbr 到 rtb,这是最快的 * Z- `1 H1 }8 w% A+ j: q5 {- W5 V& p
!  The second group represents a Ribbon group that references an existing   q- @$ A; l7 v& A" a
!  toolbar with Ribbon specific style changes added to it.  There is no difference
1 q5 ^& \5 g+ i!  in how this toolbar is referenced in the .rtb file compared to the first
+ F. |9 _2 x( ^2 d6 F6 K!  toolbar as a group.  The only differences from the first group exist within
  k, [) ?) |; w: f4 A/ O!  the .tbr file itself.
  {' x* b2 d/ }% L' ~9 o!& ^" e& L* {- r5 _' i1 p
!  This approach has advantages for customers that will deploy both Ribbon and( ^6 j' E3 ^7 d9 r4 n
!  Classic Mode customizations since all the content is defined in the .tbr 4 \0 L& @; e3 k: k6 [8 f) {$ A) [
!  file and it will stay synchronized in both modes.  Only one set of customizations
5 Q6 r5 V$ T0 r9 E- D. X3 B6 _" [- N!  will need to be maintained while still making use of RIBBON_STYLE to
- M: A$ G. P% ]# I' y" X" Z" N2 Y/ l!  control the presentation of the buttons on the Ribbon.3 S0 S' q8 P0 V
!( ^' f! V' r9 I+ y
GROUP  customer_toolbar_alternate.tbr
" g6 y1 B) W6 x  l0 z! y$ F
% d( A! Y& _& j4 f# `. ~2 h6 B1 s* T$ F!  The third group represents a Ribbon group that has been created explicitly
0 p3 [7 X" Z" ~1 J8 Q!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the* [5 `0 R. K& n  u$ f* u
!  preferred option since the user will be able to take advantage of all the , s4 |& S$ y* n, \
!  layout styles and containers offered by the Ribbon.  
1 d4 K$ J4 v8 j- k! r  P; d!
- D, e5 n% B9 C0 v4 Y, h% J2 r0 ]8 ~!  For customers that will deploy both Ribbon and Classic Mode customizations, ) ?9 v* A  R. @
!  this approach will result in no synchronization and two sets of customizations
9 s8 i( l1 c: @!  will need to be maintained.6 B& Y# I: ~% G2 J3 @) a% X$ j
!
) N7 D7 G$ E) v; X" `!  A group can alternatively be defined directly inside the .rtb file by using the
7 w( H# Q, ~! J$ V9 F!  keywords BEGIN_GROUP and END_GROUP.  
( Y* X: H' }4 T. ?!+ D* W7 F, F. Q' X" X
GROUP  customer_group.grb
5 l0 K6 K# I$ ^8 j' a
) ^5 F) g9 {) R( F$ X( p!  Example of a button that is placed directly on the Ribbon without being
& g; }9 Z$ p5 Q6 |" @2 i!  contained in a group.  This is a simple way to add a button to a tab& z3 O3 m# B3 e- r1 `5 H5 m/ f
!  but is not recommended for many buttons since groups have advantages.
) ~& U. j! a8 `* p* R!  
! b0 h3 u* }+ F( f! p0 u- c!  A few advantages of groups:
" R! j6 Z7 Z- C8 E+ g!     1. Easier to move many buttons around together in quick customization.  
" U0 ?& L0 t, u1 t!        For example, MB3 on a group and choose "Add to Left Border Bar".  # h5 l+ E% S: y
!        This will move the whole group to a new location.  If buttons are
7 B8 p* F! k/ n8 V: s+ _* z0 [!        not in a group, they need to be moved one at a time.
9 Y9 c3 v" U+ L; i3 q* {; Q!' d( V. w' p- z
!     2. Provide a label to describe its contents.
9 I3 m. j6 d  ]( [!
/ P9 n" R1 G' h, F6 W- C4 jBUTTON CUSTOMER_BUTTON_15 [' C/ v6 j3 T, }2 h7 _: u( u
LABEL Button1 Directly on Tab
; C9 v: x. t; J

" S6 Y3 g5 u& H, l3 K' P9 B
部分菜单可以单独写成group gallery 作为对应后缀,重复调用
) J# @  F8 W$ c' r8 H" o!  Example of a gallery defined in a GRB file." ]1 x" U  t$ y5 I7 E, u5 q
! $ P5 {; H# M  S" E
!  If this gallery is to be used in other places, then it could be ' H3 w( H! F; F: L8 y8 U2 i
!  defined in its own gallery (GLY) file and referenced here
% M) ]* ~* j$ m8 `' b* A! O5 r!  Example:
# |; h' V% Y0 O' I9 G5 P!    GALLERY customer_gallery.gly
& E; V, [2 G* K' g/ E* y/ e' k!
' `7 M# Q& v( {* G7 GBEGIN_GALLERY  CUSTOMER_GALLERY. K5 |3 i4 e. ^" a
COLUMN_IN_RIBBON 2, z& F9 I, `& J# r
COLUMN_IN_POPUP 29 E/ y$ {4 p" p  y% A  e
LABEL Gallery
9 O- ~2 x! d  AGALLERY_STYLE MEDIUM_IMAGE_AND_TEXT3 M' w% G" B3 ]! J. j0 {
2 {5 C" z* c9 e8 f+ b- O' q" |! n2 R7 b% `
    BUTTON CUSTOMER_BUTTON_2
& @2 _8 Y6 L; }# Q    9 [8 j8 o8 Z1 m, R. q5 s6 ~
    BUTTON CUSTOMER_BUTTON_3
; r" k9 I5 }( m/ N+ q4 ?# ^    + @) h' Y) O$ ~1 `7 m
    BUTTON CUSTOMER_BUTTON_4& E; S  b3 a: R# o9 M! D
   
" t# v) P0 x) u' o. C' ^    BUTTON CUSTOMER_BUTTON_5
0 W& {+ R" k) a. o' n+ f    ! m7 S' C/ D" N8 o
END_GALLERY; \, C. ~5 q* e. O6 P# s( ~
$ T% c, U! B, a8 \( K8 x* X" |
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了