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

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

[复制链接]

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

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

admin 楼主

2018-12-25 16:10:57

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

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

x

% v6 q$ z4 m2 E- Q1 {1 g7 m; w/ n# d
8 Y5 @  g, Y8 E, x6 c/ B9 k
$ T6 K5 i" x: N& F2 T8 f  F
首先认识下关于菜单的后缀文件6 p2 t0 e: @5 |

- x$ z/ A6 U/ l: ^( B# g0 g. x
Extension
UI object
.tbr
Toolbar
.grb
Group
.gly
Gallery
.ddb
Drop-down
.rtb
Ribbon tab
.csb
Cascade
.abr
Attachment
! L% k) [5 m1 g; \2 [

- P& s3 ~' T" I8 B- HRTB作为菜单ribbon 界面定义的关键,详细信息如下
8 ]0 i0 |( l  d- ]9 g/ H% f% H3 t. y  m, ^. o( C

5 g9 D9 S) L+ l' i: ]customer_ribbon_tab.rtb  e7 T# N  M4 s. \1 S2 V
!: Y; s( r# U4 B6 n
!  Customer Ribbon Tab6 f$ f, l" g1 D; g
!   f( N, s; {) a  N( h1 u
!  This file will create a new customer tab containing three groups and
0 X4 E' Q6 I3 F, K!  one top level button.
' a. S. b2 i% C6 r* _  Q!- {, L* e; d. t+ k5 N/ |0 E3 [8 Z

) a  N2 P6 u$ e3 z+ t( FTITLE  Customer Tab4 E8 l, y% Q  ]( q% ~0 F
VERSION 170
/ Y/ r) h- k8 M2 o5 m; v( v' n( {3 @2 l- ?3 F9 \, M, U" H8 y* u
!  The first group represents a Ribbon group that references an existing
( q  o% L4 G4 C# x9 ^!  toolbar with no Ribbon style changes.  1 ?! x- p& P! o0 y
! * Y* U7 @/ e4 Z0 y/ H# H
!  This is the quickest way to add existing toolbar content into Ribbon mode." C7 @, l6 q8 C  y+ z) M
!9 |% R% X, m* \, a$ N+ ?
GROUP  customer_toolbar.tbr
, p5 t1 U! _$ C6 g
! 如果想直接切换tbr 到 rtb,这是最快的
/ E, I% B* n- a6 C  t  i& g7 p!  The second group represents a Ribbon group that references an existing
' L% D. f/ \: h2 J4 `5 G!  toolbar with Ribbon specific style changes added to it.  There is no difference# w: }4 j* Q4 A& R
!  in how this toolbar is referenced in the .rtb file compared to the first, T8 E4 l$ v9 |( o! P
!  toolbar as a group.  The only differences from the first group exist within
  J) @* D2 D* q1 d% c!  the .tbr file itself.& t/ m4 L5 }+ \: d0 H- V
!
! i) Q9 s! ^3 D) U!  This approach has advantages for customers that will deploy both Ribbon and( s' @: u* f5 ]1 S3 a6 N
!  Classic Mode customizations since all the content is defined in the .tbr
2 z  T% `3 K/ T' Q!  file and it will stay synchronized in both modes.  Only one set of customizations
, M3 S* B% ~! o) O: I!  will need to be maintained while still making use of RIBBON_STYLE to
6 \2 t  C0 k8 t. M- f3 ~; o!  control the presentation of the buttons on the Ribbon.
5 y9 _" A) M. ^* q- d2 |$ j; P2 j8 N- G!
0 w1 E7 B' h( t7 K5 P  p  F8 R9 OGROUP  customer_toolbar_alternate.tbr
; u$ n' h$ M( e- O' e" M # o% t8 Y$ f/ j' x4 `" N- |
!  The third group represents a Ribbon group that has been created explicitly) I; [1 z' \; C+ P. P
!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the% J8 u, ]) U$ P1 |( {
!  preferred option since the user will be able to take advantage of all the
+ V! ~9 k1 ]. l!  layout styles and containers offered by the Ribbon.  : c5 X) k, ?# Z
!
' S0 v# Q! G" p. Q!  For customers that will deploy both Ribbon and Classic Mode customizations,
! G& ~1 H4 R" J& Z/ Z8 Q!  this approach will result in no synchronization and two sets of customizations 0 V( m. k. U+ R/ z
!  will need to be maintained.2 @  V# Y; F" |
!
9 {. p$ |* S. `) A6 c# Q!  A group can alternatively be defined directly inside the .rtb file by using the9 \- C" {/ m- [; t) E
!  keywords BEGIN_GROUP and END_GROUP.  
0 R) D# I% u% W+ a+ H!- F4 M% d: F. b7 V/ ^7 _2 {
GROUP  customer_group.grb* y+ F; d$ C! l# D/ x
6 a0 @$ o7 a! T6 c$ R% a
!  Example of a button that is placed directly on the Ribbon without being! ~+ c3 X) v( s  ?% t1 m3 j9 ^
!  contained in a group.  This is a simple way to add a button to a tab1 L3 Y: _* V& _& T
!  but is not recommended for many buttons since groups have advantages.. a) ^2 K( S& P" T
!  ( ^& x4 A! ?  X& m' a; R4 f' h
!  A few advantages of groups:
1 F$ V7 Q& w9 E' g$ \4 B!     1. Easier to move many buttons around together in quick customization.  6 y1 s+ {8 l" F6 \
!        For example, MB3 on a group and choose "Add to Left Border Bar".  
/ H/ a9 M' E$ `6 @! [) q# {+ f!        This will move the whole group to a new location.  If buttons are
2 z: g2 j& F' D( R/ O# r% q!        not in a group, they need to be moved one at a time.
( }) _% [! y" z!
& x: S; e) u/ w' P/ w!     2. Provide a label to describe its contents.
! I3 p9 d/ A9 `/ }2 q!
) X" u: H& e+ pBUTTON CUSTOMER_BUTTON_1
+ |, g: C4 i" w* M" @7 K( V8 bLABEL Button1 Directly on Tab
3 [; O! X- D" @
* c/ D2 |8 K$ R0 u
部分菜单可以单独写成group gallery 作为对应后缀,重复调用
, e* d( T' `( V8 U& _!  Example of a gallery defined in a GRB file.: z. o  u% ]. Z1 Y1 c7 _* {' o
!
8 K) u. y3 l4 j3 z: U+ ]: |/ L!  If this gallery is to be used in other places, then it could be
1 y  f. G9 I: H: A  J: P/ X, M5 Z!  defined in its own gallery (GLY) file and referenced here$ F9 \* }# {/ K: D" b; ?* N
!  Example:, w( [' G  M. S- j# i
!    GALLERY customer_gallery.gly. G/ {( d5 b2 Q" A' m  ]) @3 E6 s
!
# }+ l1 z7 `4 ^2 e# XBEGIN_GALLERY  CUSTOMER_GALLERY
7 I5 N" z- T7 f3 q3 x5 XCOLUMN_IN_RIBBON 2
: k% e' v! ~- L- s# uCOLUMN_IN_POPUP 2  Y* i* M3 p3 G" u
LABEL Gallery' h7 A" r, }# X6 F
GALLERY_STYLE MEDIUM_IMAGE_AND_TEXT5 A! u2 K( j3 _! T. B  A

2 e) @/ g' l' T. t' G# y' [# M    BUTTON CUSTOMER_BUTTON_2  }5 c; o" L% V& Q
   
# T  O9 F! b! w7 Y, k# m, L    BUTTON CUSTOMER_BUTTON_34 d/ T5 [$ t* y& U/ g4 k5 Z* @
   
% P0 Y( O) D8 J    BUTTON CUSTOMER_BUTTON_40 W4 x/ }+ f; u" u' Z% ^: n
    + u. v* G! T- C' B
    BUTTON CUSTOMER_BUTTON_5+ ?( J' w1 V/ M3 ]( I% H, W: @
    . D  V3 f9 y4 C$ A8 O9 E( O  f
END_GALLERY/ v, M" F$ }6 t- P& Z" I

  n2 j  E) Q! o+ a3 C
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了