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

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

[复制链接]

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

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

admin 楼主

2018-12-25 16:10:57

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

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

x

& Z8 ?) X# t1 p
6 ]5 w  P, l  F: a9 v9 a6 v5 ]/ J
! x  j% h& y, p6 n* f- q1 d* ]9 u% U+ P% t' E0 e
首先认识下关于菜单的后缀文件) q* e/ ], ?% ]" }& d3 z
% p6 R: d  S& K4 B3 b, P0 P
Extension
UI object
.tbr
Toolbar
.grb
Group
.gly
Gallery
.ddb
Drop-down
.rtb
Ribbon tab
.csb
Cascade
.abr
Attachment

  _$ e- }; K8 v% y3 j: e& L$ e0 ~0 D8 {; h
RTB作为菜单ribbon 界面定义的关键,详细信息如下
' r, i& F& A' `
1 C, h3 X, A9 T/ B1 W/ P6 k8 K: j/ E3 m; g5 p
customer_ribbon_tab.rtb
- X2 i' F' ~5 R: C* E6 o!8 ^9 p" \% K: {2 `7 m
!  Customer Ribbon Tab6 I) V, d7 ~5 q* c. D& Q% G
!
% |0 X" B$ K8 G9 s# V  _# N!  This file will create a new customer tab containing three groups and
: L. A: f4 p% T0 E0 P!  one top level button.
* t( H  ]+ d8 C0 t1 h2 E3 _!' i- e" _3 h0 n3 E8 M9 f& X
6 w) B/ W4 G- s1 n" M# P
TITLE  Customer Tab
& R, p% X0 P3 n( M+ ^VERSION 1706 C1 `) I' H1 p- W4 E) \
  v: ~! ^& E, h/ a& p
!  The first group represents a Ribbon group that references an existing
2 n2 Q; B6 ~% m% d' ]!  toolbar with no Ribbon style changes.  1 g( F; x+ n! \
!
( V" A0 x% U, I3 {8 U" X!  This is the quickest way to add existing toolbar content into Ribbon mode.( w1 s! B8 c" E7 t7 E
!
" p4 a! S( N' p8 L. w5 m$ V& K
GROUP  customer_toolbar.tbr
, ]8 b" I" _+ k, a
! 如果想直接切换tbr 到 rtb,这是最快的
( d' ^0 D& b4 z. h+ a9 Y!  The second group represents a Ribbon group that references an existing 5 E7 W) K& w6 W) g1 N
!  toolbar with Ribbon specific style changes added to it.  There is no difference
4 ]  F+ M" }& E* s4 d!  in how this toolbar is referenced in the .rtb file compared to the first
' j4 U; F! t. R2 K$ s!  toolbar as a group.  The only differences from the first group exist within
# p  L8 ~+ [$ K: T% m!  the .tbr file itself.1 e8 ]; l' b+ i6 H6 b
!% h$ B9 l) e' ~, R
!  This approach has advantages for customers that will deploy both Ribbon and
& F  k  v8 ~, _! [!  Classic Mode customizations since all the content is defined in the .tbr
6 _8 o  ~6 i$ n* ~7 G( ]0 `- R* {!  file and it will stay synchronized in both modes.  Only one set of customizations/ T# T0 Q7 E, c) U
!  will need to be maintained while still making use of RIBBON_STYLE to
1 B& R/ k& T+ Z% T, B8 A!  control the presentation of the buttons on the Ribbon.8 J0 I1 ?% s0 q: P
!
) o! O4 }! w$ p6 k, [GROUP  customer_toolbar_alternate.tbr3 N: M7 J; Q( T
. m% s+ f% C3 d2 v
!  The third group represents a Ribbon group that has been created explicitly% }: ~. `# G; b6 ^
!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the) S( V" o0 z1 T- N- E0 `
!  preferred option since the user will be able to take advantage of all the
& u+ h! L! d. \!  layout styles and containers offered by the Ribbon.  9 R3 `; M  l  ?6 w- n
!
. L: S9 U! }8 f7 v5 Z!  For customers that will deploy both Ribbon and Classic Mode customizations,
- t4 r, \2 F* {6 C1 C5 C- Q1 a1 j5 T!  this approach will result in no synchronization and two sets of customizations
% z7 u" f& O1 G/ [; N!  will need to be maintained.
- T& b0 P2 m8 R& n) A1 Z!
. A+ c" Y! R8 P2 I!  A group can alternatively be defined directly inside the .rtb file by using the: K7 D! q$ b1 ~7 [9 X7 F/ \
!  keywords BEGIN_GROUP and END_GROUP.  , X: a2 h- ]3 K" k8 s
!4 C0 ^" v! Y6 S% D
GROUP  customer_group.grb3 L4 ~% J4 x: X2 A& T! F4 d

% V( y2 N' {. Z4 X) i7 |!  Example of a button that is placed directly on the Ribbon without being+ u+ a; V; [8 ^5 s9 l8 j/ y- J1 Y& ]
!  contained in a group.  This is a simple way to add a button to a tab' L$ c% B5 C7 J( c$ j; x# `
!  but is not recommended for many buttons since groups have advantages.1 B% O6 T5 z& ^# L, `0 h
!  
* _% J0 x' r8 |  y3 O) r6 c9 ?8 c!  A few advantages of groups:! f1 D/ x6 y5 B: Q+ o$ X
!     1. Easier to move many buttons around together in quick customization.    e* w% y& Y# S5 C! P; R6 \
!        For example, MB3 on a group and choose "Add to Left Border Bar".  1 ?7 z% }3 v& I
!        This will move the whole group to a new location.  If buttons are
, |2 B8 c& h+ S) Y6 W3 A!        not in a group, they need to be moved one at a time.
" m8 E7 l0 l$ N% y) {4 u!; u/ r' M5 W8 t5 R3 s
!     2. Provide a label to describe its contents.
1 v% w# `5 S3 r6 t8 b!
) z7 k+ n6 W, }5 M) c. H* bBUTTON CUSTOMER_BUTTON_1! o+ G# `1 I' k8 s" H
LABEL Button1 Directly on Tab
# x* j' m5 T, O

/ ]+ F2 H) O# W  ^8 H' D
部分菜单可以单独写成group gallery 作为对应后缀,重复调用
. {7 \/ ]+ E( C3 `# a2 `( [!  Example of a gallery defined in a GRB file.+ z5 j- G/ t  m- M9 ~/ P
!
$ U% J5 T9 z, `9 G, Z2 E/ K# ]!  If this gallery is to be used in other places, then it could be & v7 K" |; U) G$ x7 Y: w
!  defined in its own gallery (GLY) file and referenced here
3 K; a1 t  H, ?% `' g4 ?!  Example:) g2 t5 }3 e. _! I; z
!    GALLERY customer_gallery.gly
/ S4 f. A* T, z# M* S!, Y' y1 H) z) l( p* k6 R( N
BEGIN_GALLERY  CUSTOMER_GALLERY
8 `. [5 i0 ~# t! g' M  YCOLUMN_IN_RIBBON 2
' m$ j; \( c1 c( WCOLUMN_IN_POPUP 2
2 P2 b7 T4 _- }' o" I- ?, O$ XLABEL Gallery! o/ q! m: B! j# L. ?7 Z
GALLERY_STYLE MEDIUM_IMAGE_AND_TEXT
+ ~. k' u% L' i$ G, j- c
1 `& X8 \6 L7 {8 b, W& B# K/ i6 t    BUTTON CUSTOMER_BUTTON_22 h. U/ e& }; Y3 G' y
    ( Y: S0 E- f$ s8 U8 I& _
    BUTTON CUSTOMER_BUTTON_3! m7 b( N# o& I
    , d' h/ P+ ?5 Y9 k0 S0 w5 t
    BUTTON CUSTOMER_BUTTON_4
  B( `8 e4 [" |* P8 D. W- D    . L* t7 x8 {% ^
    BUTTON CUSTOMER_BUTTON_56 E1 ?9 t6 q0 Y3 Z) Q
   
6 K, X; o; N+ y5 G7 N2 l/ XEND_GALLERY
$ J! S  E8 B0 }1 b6 M$ l. t5 H( B' T
  V  t" D8 E* p  @3 b$ N
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了