Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Distinguished Contributor
Exmateria
Posts: 215
Registered: ‎11-19-2008
Message 1 of 3 (387 Views)
Accepted Solution

Ribbon icon grayed out

387 Views, 2 Replies
01-16-2012 05:31 AM

Is it possible to have a custom grayed out icon in the ribbon when this icon has been used at least once? For example, the user clicks on this icon and it becomes gray to notify the user it has been used. The purpose is to load certain DLL with Netload only once.

I could not find a way to control the appearance of single button in the ribbon directly. However, it is possible to emulate the behavior quite well, by switching from one pre-defined workspace to another pre-defined workspace. I assume you are a bit familiar with Customize User Interface and workspaces.

 

To do this, You have to take the following step (reads more complicated than it is):

 

  1. Make a alternate image for the button, redraw it in such a way that it appears to be grayed-out
  2. Make a copy of the ribbon panel that contains the button you want the user see as changed. The original panel will be used to show in the initial load of the interface, the second version of the panel will be used to show after the load of the DLL's. Therefore, in the second version of the panel, you have to replace the button image for the grayed-out version of the image, and replace the macro to do nothing (or show an alert box that the stuff has been loaded already). For these two versions of the panel, you may keep the field Display Text identical. This is the panel label as it is shown to the user, so for the user both panel versions will appear to be the one and the same.
  3. Next,  make a copy of the associated ribbon tab. In the second version of the tab, replace the original panel with the version that contains the grayed-out button. Again, for both versions of the tab you may keep the field Display Text identical, for the same reason.
  4. Next, save and customize two different workspaces. The workspace you use initially has to show the tab that contains the panel with the "working" button image and hide the alternative tab. The alternative workspace is intended to be current after the DLL's has been loaded, so this has to hide the initial tab and show the alternative tab that contains the panel with the grayed-out button image.
  5. Finally, the macro of the "working" button in the original panel, should not only load the desired DLL's, but make the alternative workspace current as well. For that second part, you can use (setvar "wscurrent" " [YOUR WORKSPACE NAME] ")

I've been able to roll-out similar pre-defined workspaces for all our users, by saving the workspaces in the Enterprise Customization File. This makes my pre-defined workspaces read-only for users, while still allowing users to save their own personal workspaces.

Distinguished Contributor
mmoolhuysen
Posts: 159
Registered: ‎08-26-2003
Message 2 of 3 (353 Views)

Re: Ribbon icon grayed out

01-19-2012 09:02 AM in reply to: Exmateria

I could not find a way to control the appearance of single button in the ribbon directly. However, it is possible to emulate the behavior quite well, by switching from one pre-defined workspace to another pre-defined workspace. I assume you are a bit familiar with Customize User Interface and workspaces.

 

To do this, You have to take the following step (reads more complicated than it is):

 

  1. Make a alternate image for the button, redraw it in such a way that it appears to be grayed-out
  2. Make a copy of the ribbon panel that contains the button you want the user see as changed. The original panel will be used to show in the initial load of the interface, the second version of the panel will be used to show after the load of the DLL's. Therefore, in the second version of the panel, you have to replace the button image for the grayed-out version of the image, and replace the macro to do nothing (or show an alert box that the stuff has been loaded already). For these two versions of the panel, you may keep the field Display Text identical. This is the panel label as it is shown to the user, so for the user both panel versions will appear to be the one and the same.
  3. Next,  make a copy of the associated ribbon tab. In the second version of the tab, replace the original panel with the version that contains the grayed-out button. Again, for both versions of the tab you may keep the field Display Text identical, for the same reason.
  4. Next, save and customize two different workspaces. The workspace you use initially has to show the tab that contains the panel with the "working" button image and hide the alternative tab. The alternative workspace is intended to be current after the DLL's has been loaded, so this has to hide the initial tab and show the alternative tab that contains the panel with the grayed-out button image.
  5. Finally, the macro of the "working" button in the original panel, should not only load the desired DLL's, but make the alternative workspace current as well. For that second part, you can use (setvar "wscurrent" " [YOUR WORKSPACE NAME] ")

I've been able to roll-out similar pre-defined workspaces for all our users, by saving the workspaces in the Enterprise Customization File. This makes my pre-defined workspaces read-only for users, while still allowing users to save their own personal workspaces.

Distinguished Contributor
Exmateria
Posts: 215
Registered: ‎11-19-2008
Message 3 of 3 (335 Views)

Re: Ribbon icon grayed out

01-20-2012 05:15 AM in reply to: mmoolhuysen

Thanks for your solution. Its seems the only way to do it.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.