How to Disable Custom CUI buttons

How to Disable Custom CUI buttons

Anonymous
Not applicable
1,258 Views
3 Replies
Message 1 of 4

How to Disable Custom CUI buttons

Anonymous
Not applicable

I have created a CUI file, which contain my customized buttons. I want to disable some buttons sometimes.

 

When I click one of my customized button, AutoCAD executes my customized command signdata. All the setting of this command are follow:

Display
--
Name					CustomSign

Appearance
--
Button Style				Large with Text (Vertical)
Group Name			

Command
Command Name                            CustomSign
Description				Sign current drawing
Extended Help File		
Command Display Name		        Sign current drawing
Macro					^C^Csigndata
Tags						

Access
--
Key Tip
Tooltip Title				CustomSign

Advanced		
--
ElementID					xxx
ElementID					xxx

Images
Small image					xxx.bmp
Large image					xxx.bmp

I want to disable this button when system variable tilemode’s value is 1, when tilemode’s value is 0, enable this button again.

 

I have found this page about Disable Ribbon Buttons.

https://knowledge.autodesk.com/support/autocad-lt/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/Au...

This page gives a demo as follow:

$(if,$(getvar,cmdactive),~)MOVE^C^C_move

I change the Macro content from ^C^Csigndata to one of follow, but it does not work

$(if,$(eq,$(getvar,tilemode),1),~)SIGNDATA^C^Csigndata
$(if,$(eq,$(getvar,tilemode),1),~)MOVE^C^Csigndata

How should I modify the command settings?

 

 

0 Likes
1,259 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

AutoCAD official page “About Controlling the Display of Ribbon Buttons” is as follow:

You can gray out a ribbon button by using a DIESEL string expression.

 

When grayed out, the macro and submenus associated with the ribbon button are made inaccessible.

 

The following DIESEL string expression, placed in the Macros property of the Properties pane, disables the macro while another command is active.

$(if,$(getvar,cmdactive),~)MOVE^C^C_move

But I don’t know how to modify my .cuix file to achive what I want.

 

Really appreciate your replay, thanks!

0 Likes
Message 3 of 4

m_latz
Advisor
Advisor

It has been a very long time since I have written something in DIESEL, but try this:

 

$(if,$(getvar,tilemode),,~)SIGNDATA^C^C_signdata

 

regards

 

Markus

0 Likes
Message 4 of 4

Anonymous
Not applicable

Dear m.latz, thanks for your replay!

I have tried the method you mentioned, but it doesn’t work. Maybe there is something wrong with my cuix file.

 

Could you give me a .cuix file demo that can achieve what I want?

My email is: fj100860@gmail.com

 

Thanks!

0 Likes