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

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

[复制链接]

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

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

admin 楼主

2018-12-25 16:10:57

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

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

x

8 G" }4 P, b- N4 c
$ r& R8 G1 ^; {8 d
, |& |) A3 R! O! {9 l/ K* w6 P5 Z$ M
首先认识下关于菜单的后缀文件: ]8 `( i- C3 r  y# G6 C4 L3 S3 e
! V4 }/ O; L" O: _5 A
Extension
UI object
.tbr
Toolbar
.grb
Group
.gly
Gallery
.ddb
Drop-down
.rtb
Ribbon tab
.csb
Cascade
.abr
Attachment
! p6 t& y3 G3 L3 j8 H' p: S6 e# o
8 z. Z' a+ @7 b
RTB作为菜单ribbon 界面定义的关键,详细信息如下
; G2 s, L1 W6 d) h* _1 h1 X/ D4 q* ^5 S  m! ?% l6 z4 o

5 }* U( B" h- {$ d- qcustomer_ribbon_tab.rtb
: F3 P6 l, q/ {; M0 O+ `; s0 }& [!$ P0 s( h5 s  ?3 Y8 |
!  Customer Ribbon Tab, Z2 h5 y: r6 @9 t6 h1 G' m: V
!
0 C3 ^% x9 ?. V4 d: A!  This file will create a new customer tab containing three groups and, }' _3 Y8 _% i
!  one top level button.
5 o- f! r2 G3 p* n; `0 X!* I$ m$ ]( j0 m* z1 R, X6 S

- F: s* w6 O2 T, W/ |6 ~4 C* [+ UTITLE  Customer Tab
. Y( F# e3 ?' r) nVERSION 170
, B$ g6 a3 |, c) B
( K! l& t4 ], O9 D  K) E" E* d!  The first group represents a Ribbon group that references an existing
4 q4 G% ^; f/ s  ?. F  _; {5 J!  toolbar with no Ribbon style changes.  $ W. [/ o8 D% j0 V
! 4 b) V0 d- l% E9 Z8 f
!  This is the quickest way to add existing toolbar content into Ribbon mode.& Q- d- ~! U. j2 i9 P% Q
!4 X4 C5 |% U/ x+ y8 x! f
GROUP  customer_toolbar.tbr
3 Z' y. U' k1 Z% q, u: W9 [( O
! 如果想直接切换tbr 到 rtb,这是最快的 7 l4 Q2 |4 i! i+ S  y/ I
!  The second group represents a Ribbon group that references an existing
- F' z3 B( V  _0 x6 [. g!  toolbar with Ribbon specific style changes added to it.  There is no difference
4 m/ {$ l: I* o% S! r1 z- X6 Y!  in how this toolbar is referenced in the .rtb file compared to the first
3 R& a3 F3 x! K% `* P!  toolbar as a group.  The only differences from the first group exist within
6 B6 x, B+ ], h" t!  the .tbr file itself.) n$ `0 ]# h  P, t
!! c+ r, {5 f- S% B
!  This approach has advantages for customers that will deploy both Ribbon and" ]' T+ o. ~" q4 a% t, i
!  Classic Mode customizations since all the content is defined in the .tbr
* v" p& W& |. u) w2 x!  file and it will stay synchronized in both modes.  Only one set of customizations6 m4 J$ h8 R: @2 O! B. q! y
!  will need to be maintained while still making use of RIBBON_STYLE to ( z, `/ s# S& ^& G: P
!  control the presentation of the buttons on the Ribbon.
: m! j* E3 ^7 \2 [7 l) ]!
3 A3 Z) `; x8 f6 OGROUP  customer_toolbar_alternate.tbr9 @) o# A0 e3 Z0 L0 z0 W

, U: ?2 r& d' }!  The third group represents a Ribbon group that has been created explicitly4 k" j8 ?4 K( ^
!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the% a0 u- M* _. G: |% L& P$ R2 z
!  preferred option since the user will be able to take advantage of all the
0 p) N# }% s8 X) k1 \!  layout styles and containers offered by the Ribbon.  
1 s# B# i- \, _* G; V8 G- v!
% Q  X- F% S! D!  For customers that will deploy both Ribbon and Classic Mode customizations, 6 R7 c9 f% \+ v1 l5 [0 V5 V
!  this approach will result in no synchronization and two sets of customizations
# b* I3 m: j8 J  ^3 K1 h!  will need to be maintained.2 c+ v& v+ {5 N9 @+ O& |
!% M2 P, s+ a4 b7 h( p  f4 D" u
!  A group can alternatively be defined directly inside the .rtb file by using the, d5 _% _2 ~, T! K, h* M+ a
!  keywords BEGIN_GROUP and END_GROUP.  
4 z- x; ^  h& v: N! D!
5 {" `$ w8 p* [" ^$ [* RGROUP  customer_group.grb. m, Q8 c* R$ T4 c& O

- I$ [: f8 A9 y3 \!  Example of a button that is placed directly on the Ribbon without being) w% s2 Z' z9 M% w9 a
!  contained in a group.  This is a simple way to add a button to a tab3 q/ _4 [1 a7 e- L2 O1 [4 u
!  but is not recommended for many buttons since groups have advantages.: _  C" K) x) g( `' e3 X) g
!  $ v2 V& q3 ]" e: y3 V/ D
!  A few advantages of groups:; a* Y7 s: `( S7 b! P; v
!     1. Easier to move many buttons around together in quick customization.  7 R  [( u/ r5 L
!        For example, MB3 on a group and choose "Add to Left Border Bar".  ! J( i- N$ T. m% j+ E2 O" A- g! D
!        This will move the whole group to a new location.  If buttons are
% a( s5 A. x/ R7 m2 K" P: R!        not in a group, they need to be moved one at a time.! O( \% g7 N; j  _0 t3 ?4 f8 F3 P
!
2 q# X- M" ~+ d. j) x  h!     2. Provide a label to describe its contents.
$ i! E$ j& g, m! `/ }) r!' q% n) h$ o( F! t6 v$ E: f7 E
BUTTON CUSTOMER_BUTTON_1' p8 f1 m& A' k$ A, ^; S1 g
LABEL Button1 Directly on Tab

" l. s% r. h9 f" Y1 V/ \: {" a

5 p0 P# k2 T  Q8 E! ^! W0 u3 ?
部分菜单可以单独写成group gallery 作为对应后缀,重复调用
7 `% H  S5 g. d9 M0 d& ]4 o* _!  Example of a gallery defined in a GRB file.
4 R  ~0 ~6 W! n! p!
' [5 q9 a  h, E" W2 ]! N$ c!  If this gallery is to be used in other places, then it could be
1 @  H7 u6 y$ I1 J- I!  defined in its own gallery (GLY) file and referenced here3 d4 N9 j4 c2 f4 c5 b$ Y) Q
!  Example:
- T' @7 _  }) X: A9 y$ B8 _!    GALLERY customer_gallery.gly
+ `! D$ Q, }- T( J$ x3 v!2 q- i, ?, N# A$ T7 a  k4 f
BEGIN_GALLERY  CUSTOMER_GALLERY
! H9 \/ y0 ]  c- J7 ^5 `COLUMN_IN_RIBBON 2: L; M, ]% o# G% \3 g( L; e
COLUMN_IN_POPUP 2
6 K) N0 E$ D4 [$ M2 N% ULABEL Gallery
% D4 d" j# y1 r5 n, pGALLERY_STYLE MEDIUM_IMAGE_AND_TEXT
1 m; u, H6 \/ A' |# H6 k& `1 H6 c* G! W
    BUTTON CUSTOMER_BUTTON_2
; e0 _, l* ~$ C" w! @$ q4 T  ?" z3 ?; K   
  M0 ~. S' E5 T! \    BUTTON CUSTOMER_BUTTON_37 l( O1 x8 c! l3 o1 \% N( [
   
( \# R& b3 U! C8 V    BUTTON CUSTOMER_BUTTON_4/ Y, _0 L- [7 N* c! A
   
5 F4 h( ]5 v* w2 }3 b! h    BUTTON CUSTOMER_BUTTON_5- X3 [( z1 r& ~4 D7 T7 c, o1 w
      F  E8 ?! R* i# J
END_GALLERY6 [) {+ }: @7 ^, w& K) O( b

3 n! H% M" p- P1 I/ D; H
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.diantuankj.com/ doTeam.tech
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 注册

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了