TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Lupo76 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?
-
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.
-
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 :-(
-
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?
-
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
-
(getvar 'colortheme)
1 = light 0 = dark
-
Thank You !!!
-
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).
-
Also the COLORTHEME variable is not available in 2014.
-
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
-
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"
-
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.
-
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?
-
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.
-
Have you read: http://www.theswamp.org/index.php?topic=49071.0 ?
-
how have you resolved?
-
how have you resolved?
I apologize if I did not answer.
I solved the problem bypassing.
I created 2 sets of icons, for the two themes of AutoCAD.
I maintained then 2 *.BMP file for each icon, I have not done the DLL
So according to the variable COLORTHEME I decided to copy (via code lisp) files *.BMP correct.
It is not a very clean solution but it works.
-
I tried the solution with (vla-setbitmaps button bitmap bitmap) but I had some strange results with the menu. For the moment I have not tried other solutions...
Thanks.
-
I tried the solution with (vla-setbitmaps button bitmap bitmap) but I had some strange results with the menu. For the moment I have not tried other solutions...
Thanks.
I used vl-file-copy to overwrite the file icon and then ask the user to reboot the cad.
-
I used vl-file-copy to overwrite the file icon and then ask the user to reboot the cad.
I need a temporary faster method without recompiling the menu... the original icons should appear when I open a new DWG.