PLM之家PLMHome-工业软件与AI结合践行者

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

[复制链接]

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

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

admin 楼主

2018-12-25 16:10:57

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

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

x

. P) k7 p' G8 K- p( o* C& z. a1 Q/ F2 K& m

+ R( E2 o! t% B9 h- L7 d+ F5 r# q# T; }' |6 c6 D
首先认识下关于菜单的后缀文件
' [$ R: e4 @, p2 o8 u2 N# a# y( G& s1 \$ W
Extension
UI object
.tbr
Toolbar
.grb
Group
.gly
Gallery
.ddb
Drop-down
.rtb
Ribbon tab
.csb
Cascade
.abr
Attachment
' S, b# z  Q  n
4 n3 C/ a3 R3 u7 Y
RTB作为菜单ribbon 界面定义的关键,详细信息如下
) b2 G- {; |* v8 A7 ?. O4 p" e+ s  }. W, p
% p8 `# l! x; t, v
customer_ribbon_tab.rtb" Q. Z  T1 l4 @6 W9 ]% x& O
!
6 F  t! r& z7 {+ U1 D$ Z!  Customer Ribbon Tab; R  C% i- m* q4 g6 R3 U
! 5 j% j3 r/ L* g. G# O" o
!  This file will create a new customer tab containing three groups and! t2 Z, m6 s) \8 I2 E  A: B
!  one top level button.9 O6 O, a3 C  J* C: q, v
!
8 D8 i. Z, e8 h1 Q) v* ^. {
, S( U+ s0 _5 LTITLE  Customer Tab  K" r7 y4 O* Q& X0 ]' Y9 b  W
VERSION 170
* d0 M$ o4 R( e* k2 ~% p& j/ ~0 s+ a2 ~+ l
!  The first group represents a Ribbon group that references an existing
* t- Z+ N* f2 f# q!  toolbar with no Ribbon style changes.  - Y3 W! W6 \; S
!
" j: E6 A( x6 `+ x' w!  This is the quickest way to add existing toolbar content into Ribbon mode.
8 P: k2 g  j+ F!& u3 k/ V! g( F! z  Q9 U
GROUP  customer_toolbar.tbr; d( C& T$ b$ g- r5 J
! 如果想直接切换tbr 到 rtb,这是最快的 . p( O6 [8 Z, ]6 h% J
!  The second group represents a Ribbon group that references an existing 4 V4 {! U+ B, c! ^- K
!  toolbar with Ribbon specific style changes added to it.  There is no difference
& _6 O0 e8 O$ P$ d0 C7 D5 E/ w$ ~!  in how this toolbar is referenced in the .rtb file compared to the first
" F/ _4 Q1 h) F6 z: ], h- D!  toolbar as a group.  The only differences from the first group exist within 6 x5 u4 c/ ]  |- y2 }( I
!  the .tbr file itself.
$ {" y+ E: n3 E5 u!
, q5 V1 V) N  z- d9 z!  This approach has advantages for customers that will deploy both Ribbon and
( t% ]5 E  j8 U0 c" G!  Classic Mode customizations since all the content is defined in the .tbr
; _% d, B1 Z! t3 A5 z!  file and it will stay synchronized in both modes.  Only one set of customizations3 N4 C( L5 c/ H: h7 C0 u
!  will need to be maintained while still making use of RIBBON_STYLE to
$ N* L: B) k7 Q!  control the presentation of the buttons on the Ribbon.
7 S  l# g) x  F* Q!9 w  ]* W+ |% h0 A9 S0 N& B; ?9 h
GROUP  customer_toolbar_alternate.tbr7 ]2 K0 W! s; V# D6 A' `: L
5 e! P) s/ Y7 s( M( {  @' W8 J
!  The third group represents a Ribbon group that has been created explicitly6 `7 d% j# D6 e9 T
!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the4 |; h; Z/ {: s
!  preferred option since the user will be able to take advantage of all the   \; n2 j$ Z" z: u4 b* \* T
!  layout styles and containers offered by the Ribbon.  
3 }  g$ W) x- {' a7 [5 g; T5 W!" z- K9 P5 R) J: j) t9 p, t/ A
!  For customers that will deploy both Ribbon and Classic Mode customizations, & C( h2 L+ ~1 ~
!  this approach will result in no synchronization and two sets of customizations 3 H% x! ^3 ?4 M8 l
!  will need to be maintained.0 }2 ?; Q  {. Y- X" U  Z0 `3 O
!1 Y: |  ?- ]1 O& ^& U
!  A group can alternatively be defined directly inside the .rtb file by using the
' J' S/ t2 u, [: r/ p, s!  keywords BEGIN_GROUP and END_GROUP.  0 Z0 w+ `2 G$ P4 J, S. ^  A
!9 \6 g. E  K+ B9 y0 t, C
GROUP  customer_group.grb
2 H- Y% A: b2 y9 a' V3 d" J/ {+ `- F/ ~, U# o$ I6 B4 p; Y1 ^
!  Example of a button that is placed directly on the Ribbon without being: w$ |1 \1 E2 e; }5 S2 w2 w* H1 h7 D
!  contained in a group.  This is a simple way to add a button to a tab
9 ?. H6 ]: W5 v: U8 o- W0 @!  but is not recommended for many buttons since groups have advantages.& r; g9 ?$ b. s3 L+ l8 K6 Z' T
!  
' Z9 M. Q" I7 R7 v% c8 U  L!  A few advantages of groups:. A5 ?% w' t& n0 C
!     1. Easier to move many buttons around together in quick customization.  
' ?6 W0 ~1 T, ~0 J% O4 p!        For example, MB3 on a group and choose "Add to Left Border Bar".  ) Y3 L' K. x" U6 Z
!        This will move the whole group to a new location.  If buttons are 8 E) \4 d$ E; [, u& t
!        not in a group, they need to be moved one at a time.; i' [, {& [3 a, ~0 d9 I% u
!6 r, |  i- m$ u7 C. d3 d
!     2. Provide a label to describe its contents.
7 H% i( T' T2 C$ s" _2 g!, _, r/ n8 r1 \9 t
BUTTON CUSTOMER_BUTTON_17 D. ^4 O3 w- c* ]# e: h
LABEL Button1 Directly on Tab
4 G! p: }6 G1 K9 }% i* a! E
1 t& Y+ S1 T; d" e
部分菜单可以单独写成group gallery 作为对应后缀,重复调用
2 y4 I1 O' e( k' Q!  Example of a gallery defined in a GRB file.2 D5 O2 z! d  ~" U" V2 X, y( f1 @
! % c- E# M1 I9 [+ M
!  If this gallery is to be used in other places, then it could be 5 |* ?" b% D6 u, r
!  defined in its own gallery (GLY) file and referenced here" y4 X3 P& E. ?" z' N
!  Example:+ v- }! N- g- z+ N" Y  O( o0 v+ E) c
!    GALLERY customer_gallery.gly: l3 P$ X. L) |7 |6 x
!/ k- X( V# Y' }. z
BEGIN_GALLERY  CUSTOMER_GALLERY; b. J  B. k5 @; _/ ?. k% O
COLUMN_IN_RIBBON 2; R7 c0 K  N* X2 M
COLUMN_IN_POPUP 2
& l0 F+ u0 a8 D9 {' {LABEL Gallery/ [- D* e) P& l' v/ R7 N2 C* A
GALLERY_STYLE MEDIUM_IMAGE_AND_TEXT1 Y$ G' X' t9 ^. b9 w
! u  k1 z, S! N  x' X# L' Y
    BUTTON CUSTOMER_BUTTON_2& q& l& x/ g# o+ X0 g. l
    . t  i' l. e4 P3 r7 v
    BUTTON CUSTOMER_BUTTON_3
( c9 c. `" a2 y' }5 b    4 i: e. I6 K+ i: g- i1 q, \7 l7 g
    BUTTON CUSTOMER_BUTTON_4% F$ K5 R! `9 n8 {
   
4 Y* W5 N- e8 u, G; l. V8 c    BUTTON CUSTOMER_BUTTON_5
* F# g# k! Y9 G    # t8 ?, a* n. x& A4 h3 `' H
END_GALLERY
# j1 v$ K6 ^7 g4 E, j
- _, }5 D7 u7 A# K1 I4 G( 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二次开发专题模块培训报名开始啦

    我知道了