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

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

[复制链接]

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

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

admin 楼主

2018-12-25 16:10:57

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

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

x
/ L+ W" U$ Z/ B$ F7 ]$ d6 W

1 ~) ^/ h. s. a& I+ ?7 E. v5 A% r' d8 W9 L

  w- y* R7 p1 @# R- V7 X. C' |- `首先认识下关于菜单的后缀文件
7 g5 a& Q/ ~! L
$ @  k9 t6 @, g7 ?5 U' J6 k; W- @( W
Extension
UI object
.tbr
Toolbar
.grb
Group
.gly
Gallery
.ddb
Drop-down
.rtb
Ribbon tab
.csb
Cascade
.abr
Attachment
$ \. b/ i8 C3 K! N

, l! G$ h5 T2 e, zRTB作为菜单ribbon 界面定义的关键,详细信息如下
6 N; k0 ]" z( u* V; @2 H+ h5 t) g$ n+ g

+ T& A& I! n, p' qcustomer_ribbon_tab.rtb
) L- E  Y1 V! T9 a!
! S+ x! ]% w, R% }!  Customer Ribbon Tab2 |& Y# C* h* z1 [$ Y
!
* s, m! D$ R; v/ m0 E3 @) a0 L!  This file will create a new customer tab containing three groups and
6 W6 k8 Q6 h+ q( s!  one top level button.& J6 J4 n. V' }/ p7 k; n
!6 p/ A; m# u4 i0 [5 G) p8 m

4 {9 @7 H% A1 y4 q+ JTITLE  Customer Tab
) Y8 ]5 `2 [$ s+ W! Z! [+ @% UVERSION 170
% q" d; S6 K9 M' A& I: o& a6 D' O' `: b% {6 [
!  The first group represents a Ribbon group that references an existing
6 {. W# E+ E* V  M# n7 q* P!  toolbar with no Ribbon style changes.  $ _  I( ]/ P8 h4 z, i
! ' x5 U# p: Y4 c
!  This is the quickest way to add existing toolbar content into Ribbon mode.
' K1 t2 _5 N6 a!0 c" p0 ?" A) P- h, ]# D
GROUP  customer_toolbar.tbr
' {9 ~' g! @0 }7 T; w5 K
! 如果想直接切换tbr 到 rtb,这是最快的 9 ~8 b3 F. e# Y+ q9 O
!  The second group represents a Ribbon group that references an existing 1 b# Z+ d! B9 B* c2 I* V
!  toolbar with Ribbon specific style changes added to it.  There is no difference
6 F! @# P+ r/ p! c3 S8 B!  in how this toolbar is referenced in the .rtb file compared to the first( U6 g  y& k; a4 X8 ~8 M
!  toolbar as a group.  The only differences from the first group exist within 0 Q1 [. d* Y% @- y
!  the .tbr file itself.
9 [8 ]2 u+ Z4 W( M7 z!
; J8 B; r9 P5 `4 t/ h!  This approach has advantages for customers that will deploy both Ribbon and& A  z/ o3 E$ O" _) R
!  Classic Mode customizations since all the content is defined in the .tbr , P! D. Z7 A% w5 U! z: W
!  file and it will stay synchronized in both modes.  Only one set of customizations7 o. V% T- `# p3 i9 ^6 J& f& D+ u
!  will need to be maintained while still making use of RIBBON_STYLE to 0 M# X( J, T. j( l
!  control the presentation of the buttons on the Ribbon.
2 u! B- I( a; N9 p# {7 o!, P* O8 I8 R' t
GROUP  customer_toolbar_alternate.tbr$ n6 T& W7 J4 C% U) m! S- V

. W- ~4 J4 ~: k. h# f5 t, Q  Y( Y!  The third group represents a Ribbon group that has been created explicitly
4 M/ `7 w3 T6 F5 ]1 o2 ]& v!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the
$ w' J7 k4 E/ M* [, O!  preferred option since the user will be able to take advantage of all the 6 D- `0 f' r6 U2 u8 n0 c
!  layout styles and containers offered by the Ribbon.  . a! B! s+ _) q  y
!
* p2 y5 y+ G1 w; @) \!  For customers that will deploy both Ribbon and Classic Mode customizations,
" F3 @$ h7 f: z( X/ h6 c8 c!  this approach will result in no synchronization and two sets of customizations
. f$ W6 ]" U1 T- |) ]+ \!  will need to be maintained.( `+ b& j, N4 u2 n
!- W: D0 E- i" |' M7 z/ d! R
!  A group can alternatively be defined directly inside the .rtb file by using the$ L; A" A. E9 r4 f* v' |- ~; o
!  keywords BEGIN_GROUP and END_GROUP.  ! |+ d! }. _" ?( v8 g* G( |5 O
!9 E+ E. z& L7 |: ~- {1 e; M  \, B
GROUP  customer_group.grb( `& x" \6 Z! _& S4 [: K
0 q2 s# @/ `% Q
!  Example of a button that is placed directly on the Ribbon without being
& J1 A- g4 `# z# T9 y% b!  contained in a group.  This is a simple way to add a button to a tab
" W1 R7 g# O' C9 c; V!  but is not recommended for many buttons since groups have advantages.  T$ }6 R/ z- ~  J) _  ~
!  % c' w" I9 L  I" P  R- H
!  A few advantages of groups:
" W  p$ C) X4 R2 ]!     1. Easier to move many buttons around together in quick customization.  
3 I7 C& I9 x2 Z% M!        For example, MB3 on a group and choose "Add to Left Border Bar".  ( Q+ n7 n8 i6 {' @0 H
!        This will move the whole group to a new location.  If buttons are
$ b3 W# P8 T: l" ^7 a!        not in a group, they need to be moved one at a time.+ m+ e/ Q3 T6 J8 r/ n
!
+ l+ B  P6 S& |! P1 ^8 V!     2. Provide a label to describe its contents.7 R- m+ \# c" x! Z
!3 c: ]/ m6 ]2 U) R7 u: x4 m# Q1 o
BUTTON CUSTOMER_BUTTON_1
) ^- B$ Z# S9 F$ |: w$ R4 WLABEL Button1 Directly on Tab

; F9 k, P$ T2 L1 d
5 T9 w$ P6 O7 d8 v
部分菜单可以单独写成group gallery 作为对应后缀,重复调用8 k$ U6 @0 H' L1 ~
!  Example of a gallery defined in a GRB file.
: \7 P' ?: Y- G& E. D* F2 \- I! # p4 h+ p. E( v3 x! \) k1 e* a
!  If this gallery is to be used in other places, then it could be $ C# g1 r$ x  W) H  ]' R
!  defined in its own gallery (GLY) file and referenced here
7 ]4 _) S7 z/ }  s' o. f, G!  Example:( i8 m9 o3 S  f+ ?
!    GALLERY customer_gallery.gly
3 F# ?9 Y" k+ Q" z# x- b) Z!
3 n  O1 k! ~* N8 h& p) H$ WBEGIN_GALLERY  CUSTOMER_GALLERY
+ V  H% S1 `- o( }COLUMN_IN_RIBBON 2
- q* Z4 a* p, @, d% ?COLUMN_IN_POPUP 2
4 V3 t, A2 g: |! c7 PLABEL Gallery
6 ]) j, Q% m) b& }4 IGALLERY_STYLE MEDIUM_IMAGE_AND_TEXT$ S8 H+ N) e: h8 c+ }
# a/ {2 @$ R9 P) H
    BUTTON CUSTOMER_BUTTON_2
* j( S7 d# v8 [- z   
* ?1 A7 w& G3 ?& \" g/ ?, q# c2 x    BUTTON CUSTOMER_BUTTON_3  q+ Y% F# F1 C5 s0 ~
    ( K3 d6 f" R5 F5 C1 M( `  L/ B
    BUTTON CUSTOMER_BUTTON_4
0 g5 X7 K7 w) j1 d   
" E1 w) Z# V$ ~4 U    BUTTON CUSTOMER_BUTTON_5
  t% @! X& K/ |0 }  }   
# j, ]9 W6 b& h7 W# gEND_GALLERY
1 z4 I' W. }: [! z, c
% p0 E  k5 ]  ]& o% Y1 g% n/ e! u- q
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了