Author Topic: Icon for AutoCAD command  (Read 7404 times)

0 Members and 1 Guest are viewing this topic.

Lupo76

  • Bull Frog
  • Posts: 343
Icon for AutoCAD command
« on: March 30, 2015, 06:43:57 AM »
Hello everyone,
Unfortunately, to date I have never raised the issue.

My custom icons with the latest versions of AutoCAD are ugly, because their background is not transparent.
Today I read somewhere that you have to set the background 192 192 192 and this seems to work.

However, the design of the icon is black, which is fine for older versions of AutoCAD that were the color of the toolbars very clear.
Newer versions of AutoCAD have toolbars dark gray, then to have a good result should I use white, in my icons.

However, my application has to be compatible with AutoCAD 2010 to 2016 and I do not want to create a different icon for each version of AutoCAD.
Have you any suggestions?
There is a color that goes well for all versions of AutoCAD?

huiz

  • Swamp Rat
  • Posts: 917
  • Certified Prof C3D
Re: Icon for AutoCAD command
« Reply #1 on: March 30, 2015, 06:54:25 AM »
Later versions of AutoCAD support transparent PNG files.

Beware of specific colors that are difficult to combine with the dark theme, like green. That is why AutoCAD itself uses two different sets of icons.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

Lupo76

  • Bull Frog
  • Posts: 343
Re: Icon for AutoCAD command
« Reply #2 on: March 30, 2015, 07:03:52 AM »
Later versions of AutoCAD support transparent PNG files.
Ok, but I would like to make a single icon for all versions of AutoCAD, so I can not use PNG because it would not be compatible with AutoCAD2010.

Beware of specific colors that are difficult to combine with the dark theme, like green. That is why AutoCAD itself uses two different sets of icons.

as I imagined :-(

Lupo76

  • Bull Frog
  • Posts: 343
Re: Icon for AutoCAD command
« Reply #3 on: March 31, 2015, 09:52:16 AM »
Later versions of AutoCAD support transparent PNG files.

Beware of specific colors that are difficult to combine with the dark theme, like green. That is why AutoCAD itself uses two different sets of icons.

I made two icons for each command.
There is a variable that controls the theme used for deciding which icon to use.
Having 2 BMPs for each command you can do in order to automatically load the icon right?


Lupo76

  • Bull Frog
  • Posts: 343
Re: Icon for AutoCAD command
« Reply #4 on: April 01, 2015, 11:07:53 AM »
No one has the answer?
I try to better explain my problem.
I have an application compatible with AutoCAD 2012-2013-2014-2015-2016.
The user may have installed in your PC eg both AutoCAD 2014 and AutoCAD 2016.

AutoCAD 2014, by default, has the background of the toolbars light gray,
while AutoCAD 2016, by default, has the background of the toolbars, dark gray.
Furthermore, the user can use the command 'options -> View' to change the background of the toolbars
For this reason I had to create two sets of icons.

Now I would like to know if there is a variable that can tell me what setting is set in CAD user.
This way I could load the correct icons.

Eg. if:
- AutoCAD2016 + background toolbars clear: Upload icon set1
- AutoCAD2016 + dark background toolbars: Upload set2 icons
- AutoCAD2014 + dark background toolbars: Upload icon set1

To distinguish the version of AutoCAD I can use ACADVER, but how can I do to distinguish which of the background toolbars chose the user in Options -> Show?

Thanks in advance

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Icon for AutoCAD command
« Reply #5 on: April 01, 2015, 11:27:15 AM »
(getvar 'colortheme)
1 = light 0 = dark

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Lupo76

  • Bull Frog
  • Posts: 343
Re: Icon for AutoCAD command
« Reply #6 on: April 01, 2015, 11:33:13 AM »
Thank You !!!

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Icon for AutoCAD command
« Reply #7 on: April 01, 2015, 01:07:52 PM »
But what if the user switches the theme during the session?

IMO, there needs to be a way to assign multiple icons (one for each theme) to a CUI element, with AutoCAD automatically selecting the appropriate icon to display based on the active theme (similar to the existing functionality of small & large button icons).

huiz

  • Swamp Rat
  • Posts: 917
  • Certified Prof C3D
Re: Icon for AutoCAD command
« Reply #8 on: April 01, 2015, 01:21:03 PM »
Also the COLORTHEME variable is not available in 2014.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

Crank

  • Water Moccasin
  • Posts: 1503
Re: Icon for AutoCAD command
« Reply #9 on: April 01, 2015, 01:26:38 PM »
I think you'll have to compile the .cuix twice:
  • Compile the .cui with the icons of the light theme.
  • Make a copy of YourMenu_light.mnr
  • Compile the .cuix with the dark icons
  • Close AutoCAD
  • Overwrite the last created YourMenu_light.mnr with the backup you've created earlier
  • Make the folder with the .mnr-files Read-only
  • Start AutoCAD
Vault Professional 2023     +     AEC Collection

Lupo76

  • Bull Frog
  • Posts: 343
Re: Icon for AutoCAD command
« Reply #10 on: April 02, 2015, 02:53:59 AM »
Hello everyone,
thanks for your advice.
I would like to make 2 DLL file with all my icons (Dark and Light) to be overwritten depending on the Thema chosen by the user.
To do this I used the application "XN Resource Editor" that I found thanks to Google

Up to now in my file CUI I always entered in the fields "Small Image" and "Big Image" filename BMP, comprehensive extension, containing the icon.
Now that I have a DLL that all my icons (I hope that the DLL is correct), what should I put in "Small Image" and "Big Image" of the CUI file?

PS. I saved the DLL file with the same name of the file in the same folder CUI, but the icons are not loaded

I attach a screenshot of the DLL file created with "XN Resource Editor"

owenwengerd

  • Bull Frog
  • Posts: 451
Re: Icon for AutoCAD command
« Reply #11 on: April 03, 2015, 11:23:21 AM »
According to your screenshot, it looks like you used integer IDs for your icons. Integer IDs do not work with CUI menus; you must use string IDs. I'm not familiar with your icon utility, but the typical way to specify strings is to enclose them in double quotes.

Lupo76

  • Bull Frog
  • Posts: 343
Re: Icon for AutoCAD command
« Reply #12 on: April 03, 2015, 11:29:33 AM »
According to your screenshot, it looks like you used integer IDs for your icons. Integer IDs do not work with CUI menus; you must use string IDs. I'm not familiar with your icon utility, but the typical way to specify strings is to enclose them in double quotes.

Hello owenwengerd,
thanks for your reply.

do you mean that I have to save icons with "LAYISO16" (complete with quotes) instead of LAYISO16?
Where To? in CUI file or within the DLL?


owenwengerd

  • Bull Frog
  • Posts: 451
Re: Icon for AutoCAD command
« Reply #13 on: April 04, 2015, 11:51:15 AM »
do you mean that I have to save icons with "LAYISO16" (complete with quotes) instead of LAYISO16?
Where To? in CUI file or within the DLL?

In both.