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

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

[复制链接]

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

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

admin 楼主

2018-12-25 16:10:57

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

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

x

1 l* B' W  k& a! B* o  Y5 K; K
( Q% F5 Z  c- F2 k9 q3 ?. Q% u- Z8 u. p
* ~$ H) O6 d% y5 ?: ~+ o
首先认识下关于菜单的后缀文件0 b+ i. W( f: N/ H

6 B: n  A6 Q/ y
Extension
UI object
.tbr
Toolbar
.grb
Group
.gly
Gallery
.ddb
Drop-down
.rtb
Ribbon tab
.csb
Cascade
.abr
Attachment
- P1 f4 F: p5 l" M/ K' U

1 M/ _6 A4 f4 B. j; {( hRTB作为菜单ribbon 界面定义的关键,详细信息如下4 F" t* n/ p  g' Y4 H& A2 ?

- T: z0 z3 }! Q1 B8 q! r6 ?! Y
* V* g) H" c$ r8 H* }3 [) [) t, Pcustomer_ribbon_tab.rtb- [7 X  @* E$ j% c% T- I- C
!
* g& \) r1 w8 S2 s!  Customer Ribbon Tab: G8 B5 M- j  d2 y; A
! + e9 D" u+ J7 Q) v; O/ ]$ b
!  This file will create a new customer tab containing three groups and
' p5 b9 l! N0 o/ [1 U. i!  one top level button., }+ }3 m# q( y! V9 \
!- Z2 |% N2 D" \& y3 j
0 s4 U+ X$ z( E6 [( [) ?' a
TITLE  Customer Tab. r  t: z) q/ w, M: A
VERSION 170
8 C0 Q! V  P* P8 a' d: V( o+ B2 x2 @
0 r# @& i3 Z  {; \0 ~!  The first group represents a Ribbon group that references an existing
; [! x1 S6 r. E* s1 K9 O$ J!  toolbar with no Ribbon style changes.  / \/ T7 {, |2 A" s! b1 x
!
5 ~3 o  u4 n5 I: J& l- @0 F+ h  t# e!  This is the quickest way to add existing toolbar content into Ribbon mode.: @- e, K- N" ^! Q
!
* [% x) s% H- s
GROUP  customer_toolbar.tbr
2 E8 G9 K' ~) N3 ~
! 如果想直接切换tbr 到 rtb,这是最快的 9 L3 a% ^* p; X  Q4 C3 b8 V" Y
!  The second group represents a Ribbon group that references an existing
8 M. E9 n7 `: T  }: G+ L2 K!  toolbar with Ribbon specific style changes added to it.  There is no difference/ w6 @: g# ^* ]/ [. n
!  in how this toolbar is referenced in the .rtb file compared to the first
4 E4 e. [0 C4 g: i+ w8 ^) M) _!  toolbar as a group.  The only differences from the first group exist within
3 j8 X2 p+ B3 p& x- d7 Z/ D!  the .tbr file itself.% L" B8 m* C9 w/ [
!
: N( e5 M3 i. P0 C( A% u4 M- F+ V) z!  This approach has advantages for customers that will deploy both Ribbon and1 C* [0 H( M& ?/ z, B
!  Classic Mode customizations since all the content is defined in the .tbr
8 d6 b3 Y9 H8 |!  file and it will stay synchronized in both modes.  Only one set of customizations6 @9 y' @) o* f& [: D
!  will need to be maintained while still making use of RIBBON_STYLE to 9 A. X) c: ]# P& [3 D
!  control the presentation of the buttons on the Ribbon.
7 T$ k9 Y; n; L$ A. X  `9 c- i: z!
; q( k: M% i: W5 c3 q  I+ WGROUP  customer_toolbar_alternate.tbr9 ]: z9 c+ P) Y6 Z
; o1 [+ [) y5 `6 L, |
!  The third group represents a Ribbon group that has been created explicitly5 M& ~; s( N( p! U$ _
!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the
4 {$ ~& ~, Q0 \, ?( {; \- B0 t!  preferred option since the user will be able to take advantage of all the " E4 V$ z0 a* n3 B! v* P
!  layout styles and containers offered by the Ribbon.  + `5 g- R* R" [/ k& M9 Y* V$ N
!
( I3 x+ S6 E4 H; [! l6 ^!  For customers that will deploy both Ribbon and Classic Mode customizations, 9 O- @' O' |& ]
!  this approach will result in no synchronization and two sets of customizations ! h6 Y9 g; A3 l/ Y# \1 q, x
!  will need to be maintained.' X; v( Y# h$ _4 M' S
!
; u* Y0 ~. Y, P( P+ q: r6 D!  A group can alternatively be defined directly inside the .rtb file by using the9 O, H2 Q7 a7 A! f2 G, }
!  keywords BEGIN_GROUP and END_GROUP.  
" U, v" U8 Y5 H1 ?  M# j% L& l!
9 e2 w; x7 ~$ [! ~$ @  d& YGROUP  customer_group.grb
3 ?4 g$ b1 Y/ N1 I+ g3 P
" m  ~. m# M4 ]$ l!  Example of a button that is placed directly on the Ribbon without being0 m/ S! h5 ~* l
!  contained in a group.  This is a simple way to add a button to a tab2 S7 b+ z) x4 A4 \4 m
!  but is not recommended for many buttons since groups have advantages.1 ?+ M+ Q- t0 o7 j  g
!  
6 [- O0 m. Y" o5 j0 x1 }!  A few advantages of groups:
6 a3 ^" S, O) C! P7 \!     1. Easier to move many buttons around together in quick customization.  2 q3 `2 R% o6 _; Z1 K
!        For example, MB3 on a group and choose "Add to Left Border Bar".  - ]. o0 m! Y; c; a6 X4 b
!        This will move the whole group to a new location.  If buttons are ' x/ X$ @. ?$ W( l: u) P
!        not in a group, they need to be moved one at a time.
/ Z, X* `6 s5 [- l/ m0 @8 L!- G3 Q3 v' F$ o' X8 p5 C. ~, e4 N
!     2. Provide a label to describe its contents.
4 l. F8 R: n" c7 \!4 R4 P: ]& O8 L8 t& Q2 g
BUTTON CUSTOMER_BUTTON_1& @/ S0 t, T% _
LABEL Button1 Directly on Tab
1 l6 c, }3 D- m$ E" R$ F$ n
. H$ c" ^! N/ {3 O
部分菜单可以单独写成group gallery 作为对应后缀,重复调用/ q3 m: C0 ?: b  a4 x( O& F6 v: q
!  Example of a gallery defined in a GRB file.
/ m% b- g7 V" O9 F7 L!
% N  h9 E% `+ _4 [" W!  If this gallery is to be used in other places, then it could be ! O, \2 R0 y- W, Z/ R% N% {; e
!  defined in its own gallery (GLY) file and referenced here
, B2 d8 d2 `  m# s/ b7 ~4 z$ H/ u, V!  Example:
3 r5 m2 o! p$ H* D5 Y% p!    GALLERY customer_gallery.gly' ?  m% d( e+ v8 J
!7 k0 k% R& r, X# f) X3 w/ o* N
BEGIN_GALLERY  CUSTOMER_GALLERY# D: ?+ U0 b% a3 p6 l' g9 d
COLUMN_IN_RIBBON 2
* e# y0 `1 H( V' b* sCOLUMN_IN_POPUP 25 t) j6 }! Y6 J' Y8 O1 |
LABEL Gallery( o7 R7 i+ f$ G9 U
GALLERY_STYLE MEDIUM_IMAGE_AND_TEXT
: s  U; N# B0 `
" b9 \# v4 \8 P    BUTTON CUSTOMER_BUTTON_2
, F+ P# C0 M# J% Q3 n; X  x   
2 c1 {% n/ K4 d' s7 m8 T$ m5 G0 @    BUTTON CUSTOMER_BUTTON_34 A% z- `, t5 z
   
* j: F! c8 S- p$ w" |0 ^) {    BUTTON CUSTOMER_BUTTON_4
3 v4 }; p. z+ J7 _; S! u3 H# I# _    2 w2 `; @) A, E$ |
    BUTTON CUSTOMER_BUTTON_5* L) f) }# O9 Q9 Q
   
) R5 V* w3 B/ d5 l3 o# REND_GALLERY
, M5 J- [& w. }; V+ u/ T/ p
7 ]& ^& z/ g1 E" s6 Z
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了