.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Autoloader 2015 and CUIx icons

15 REPLIES 15
Reply
Message 1 of 16
Rob.O
1517 Views, 15 Replies

Autoloader 2015 and CUIx icons

I have another little Autoloader issue that I am wondering about...

 

Now that 2015 has the ability to use a light and dark theme, I am hoping we can get some added functionality in the Autoloader utility.

 

In order to support icons that work in both light and dark themes, we are back to using resource dll files to store the images. Unfortuantely, the resource dll files are not copied to the AutoCAD \Support folder along with the CUIx files upon startup.  So, when you start AutoCAD and are using resource dll files, your icons are all clouds.

 

I am working around this by using a script to copy the files over to the AutoCAD \Support folder, but those that are developing apps for the Autodesk Exchange, may not have this luxury.

 

Is there something I should be doing differently?  If not, this would be a great feature to have added!

 

Thanks!

 

Rob

15 REPLIES 15
Message 2 of 16
CanopenR
in reply to: Rob.O

Ya, i used Resource DLL's in the past, but with CUIX. if you use a bitmap for your icons, it is copied into the CUIX.  The CUIX is just a zip file. add the .zip to the cuix and then take a look at it.  Beware. I have had luck with removing items from the zip then renaming it back to cuix, but adding stuff has never had good results.

 

So simply add the bitmap folder to the support path. then us the CUI and edit the command Small/Large image field to:  BitmapName_16.bmp (or use the browse button). The CUI will find it in the support path and add it to the CUIX for you.  

 

Also on backgrounds for light or dark. setting the background color in the bitmap to (192,192,192) is what i do. AutoCAD seeing this color as transparent when used in AutoCAD. 

 

Good lucky. 

 

Message 3 of 16
BlackBox_
in reply to: Rob.O


@Rob.O wrote:

I have another little Autoloader issue that I am wondering about...

 

Now that 2015 has the ability to use a light and dark theme, I am hoping we can get some added functionality in the Autoloader utility.

 

In order to support icons that work in both light and dark themes, we are back to using resource dll files to store the images. Unfortuantely, the resource dll files are not copied to the AutoCAD \Support folder along with the CUIx files upon startup.  So, when you start AutoCAD and are using resource dll files, your icons are all clouds.

 


FWIW -

 

This isn't going to resolve the issue of automagically switching between icons when user changes the application's theme... Although you could just implement an event-driven hack to prompt user to restart their session after a theme change, which would then load the correct icon sets, etc. at startup... I've always just used a transparent background for my app icons 253,253,253 in Photoshop/Gimp, or the Light Gray button in the lower left corner of the OOTB Icon Editor dialog.

 

Cheers



"How we think determines what we do, and what we do determines what we get."

Message 4 of 16
Rob
Contributor
in reply to: CanopenR

The trick to adding files to a CUIx (.ZIP), is to remove the files (images) in question first, then close the .ZIP file.  Re-open it, then add the new files. I have never had a problem when doing it this way.  The problems only seem to occur when you remove/rename files and then add files without first closing the .ZIP file.

 

I have a very hands-off setup (never have to touch a CAD machine) to load our customization files for our office and for our outside consultants.  I am loading all CUIx files from one folder on each local machine (ApplicationPlugins).  Everything should be loading properly from the Autoloader folder (ApplicationPlugins).  I don't have the need to use custom support folders, so I would rather not add one for icons.  Until this is updated, it looks like the only options are to use a custom support folder pointed to a server location (which breaks for our outside consultants) or use a script to copy the .dll files to the Acad\support folder.  I will just continue to use the script for now as it seems to work well.

 

 

 

 

Message 5 of 16
Rob
Contributor
in reply to: BlackBox_

I don't have any issues with the icons switching when the user changes from light to dark.  That has already been resolved by Autodesk by using the _light naming convention in the resource .dll file.

 

Theme.dll

and

Theme_light.dll

Message 6 of 16
Rob.O
in reply to: Rob

Ooops... Always posting with the wrong account! 🙂

 

Message 7 of 16
BlackBox_
in reply to: Rob


@rob wrote:

I don't have any issues with the icons switching when the user changes from light to dark.  That has already been resolved by Autodesk by using the _light naming convention in the resource .dll file.

 

Theme.dll

and

Theme_light.dll


Aha... I didn't catch that enhancement actually (I've pretty much been oblivious to 2015 changes since starting my new job, and the Microsoft certificatioin courses, etc.), so for that I thank you. :beer:

 

Cheers



"How we think determines what we do, and what we do determines what we get."

Message 8 of 16
BlackBox_
in reply to: Rob.O


@Rob.O wrote:

Ooops... Always posting with the wrong account! 🙂

 


Tell me about it:

 

http://forums.autodesk.com/t5/Community-Feedback/Feedback-on-new-look-of-forums/m-p/5035828#M7505

 

http://forums.autodesk.com/t5/Community-Feedback/Feedback-on-new-look-of-forums/m-p/5060114#M7560



"How we think determines what we do, and what we do determines what we get."

Message 9 of 16
BlackBox_
in reply to: BlackBox_


@BlackBox_ wrote:

I've always just used a transparent background for my app icons 253,253,253 192,192,192 in Photoshop/Gimp, or the Light Gray button in the lower left corner of the OOTB Icon Editor dialog.


Oops; still hating this not being able to edit my own posts carp. Grrr.



"How we think determines what we do, and what we do determines what we get."

Message 10 of 16
CanopenR
in reply to: Rob

Sorry I forgot to mention the Support path addition is only for you as you build your CUIX menu. once done the path can be removed because the bitmap will now be inside the CUIX.
Message 11 of 16
mcicognani
in reply to: Rob

Rob,

you say you have no problem, using dll (with _light naming) and switching between themes.

 

I have another experience: when compiling the .mnr file (the first time your CUIx is loaded, AutoCAD correctly compile two version, one again with the _light theme, but in both theme will be loaded the same icons set, the set currently active. So if you switch COLORTHEME, the icons do not change.

 

This problem has been confirmed by AutoDesk and escaleted to engineering. As far as I know the problem has been fixed, but not yet distributed as service pack.

 

As a workaround, you may take a test workstation and let compile the .mnr once with light theme and once with dark theme. Each time you keep the correct .mnr and discard the other.

In the end you may want to manually 'touch' all the files (cuix and mnr), so that AutoCAD would not trigger another mnr compile due to date mismatch.

For a local installation works, since I can distribute also the .mnr files, but for a plugin do not work, since you can distribute only the CUIx and DLLs.

 

Here the link where you can find messages from support team confirming the problem:

 

http://forums.autodesk.com/t5/NET/Best-practices-for-updating-our-UI-to-AutoCAD-2015-new-dark/td-p/4...

Message 12 of 16
Rob.O
in reply to: mcicognani

Hi Massimo!

 

I had previously read your entire thread, but just went back and read it again to refresh my memory.

 

I do not have this problem with the theme switching.  I am using a set of icon bitmaps for the light theme and a different set for the dark theme and AutoCAD switches them without issue.

 

The only thing that I can see that I did differently than you is that I used Resource Hacker to create my resource .dll files instead of using Visual Studio.  The only reason I did this is because I had used this same tool back in the early 2000s to create my toolbar resource .dll files (back before ribbons) and I knew how to use it.  I had never created an icon resource file using Visual Studio and didn't have the time to learn how.

 

I simply add all of my bitmaps to each resource .dll file using Resource Hacker and saved it. In AutoCAD I modify my CUIx element to add the bitmap name (without extension) to either the Small image or Large image field.  I apply the changes and let AutoCAD do the rest.

 

Now that I think about it, there may be one other small difference in the way I deploy my CUIx files. I use a script file that runs each time a user logs in. This script file copies the latest CUIx files and latest .dll resource files to the local Autoloader folder of the users machine.  Not sure if this is intentional or not as it has been debated, but the Autoloader tool will then copy the CUIx files to the ACAD\Support folder, but it does not copy the resource .dll files.  So, my script also copies the resource .dll files to the ACAD\Support folder manually.

 

I just did a little testing... if I delete the mnr files from the ACAD\Support folder and restart AutoCAD, it recompiles the .mnr files of the resource .dlls and the theme switching still works properly.

 

Not sure what other differences may be causing the behaviour you are seeing, but this is what works for me.  I hope it helps!

 

 

Rob

 

 

 

 

 

Message 13 of 16
cdcaron
in reply to: Rob.O

I know this is an older post, but I am going through this process now and have a few questions.  And slightly off "Autoloader" topic.

 

I too used the compiled DLL icon method via ResHack.  Unfortunately my version of ResHack doesn't seem to work with 2015.  (cloud ? icons).   Its possible I'm doing something wrong, but I've attempted it multiple times with the same result.  I also thought maybe updating my ResHack, but all I find are virus downloads...  Yay!

 

So to my questions:

 

If you have a working version of ResHack for 2015 I would love the download link, virus free please.  Or just the website name.

 

I looked into going the CUIX (ZIP) route and couldn't figure out were the icons were located.  All I see are the "sub" cui files which don't seem to want to open as ZIPs, but XMLs.  As far as I know or can discern XML files can't hold image information....  Am I missing something?  Worse case, I'll embed via the cui editor and ditch the dlls.

 

AND there is the light/dark themes.  Light is crap because even AutoCAD default icons fade to unreadability.  Dark is slightly better except for my custome icons.  I'll broach this issue after I have a working method for the icons.

 

Thanks for the help.

 

C

 

Message 14 of 16
Rob.O
in reply to: cdcaron

Strange that I didn't get an e-mail notification for your post.  I saw it sitting at the top of the thread list only by chance.

 

Anyway... here is the link to Resource Hacker.  It's from the original author...

 

http://www.angusj.com/resourcehacker/

 

Not sure if I mentioned it in this thread, but be sure to copy the image .DLL files to the C:\Users\username\AppData\Roaming\Autodesk\AutoCAD 2015\R20.0\enu\Support folder otherwise they will not be detected.

 

Unfortunately this is the only way I have gotten it to work correctly.  The Autoloader fails to copy the resource icon files even though it copies the CUIX files to that same folder.

 

As far as the CUIX and opening as a .ZIP file, are you changing the .CUIX extension of the file to .ZIP?  Once you do that, you can simply open the file by double-clicking it. All of the images will be listed in the contents of the .ZIP.

 

I use solid color icons (metro).  For the dark theme I have found 200,200,200 works well.

 

 

Hope it helps!

 

 

Message 15 of 16
cdcaron
in reply to: Rob.O

I didn't get an email either...  hmmm.

 

Anyway, Thanks for the link, I'll have to grab it outside of work...  Firewall sees it as a Hatcker site, which is probably not wrong.  Smiley Happy

 

I did rename the CUIX extension to .ZIP.  I see CUI's of the various sub items (Ribbon, Toolbar, Workspace, etc...), couple of support XMLs and a _rels folder the contains a .rels file...  go figure.  Nothing else that I could identify as an icon image.

 

These are for my Enterprise CUIX so I keep the DLL on a shared drive.  No need to copy anything.  Smiley Tongue

 

Thanks again

 

C

Message 16 of 16
Rob.O
in reply to: cdcaron

Not sure what I was thinking, but if you are using the .DLL file containing icon resources, there should be no need to open the CUIx.  AutoCAD should automatically find the correct image resource .DLL files as long as it has the same name as the CUIx file.  Ex: MyRibbon.CUIx, MyRibbon.DLL and MyRibbon_Light.DLL

 

Not sure if it will help, but here is the process I use...

 

  • In AutoCAD, create new ribbon elements
  • Add the name of the image (without extension) in the element field for either the large or small icon
  • Save the CUI and close the dialog

(At this point the images in the ribbon elements are still clouds)

 

  • Exit AutoCAD
  • Add the image icons to the resource .DLL file and save
  • Ensure the resource .DLL file is named the same as the CUIx and is located in the same directory as the CUIx
  • Restart AutoCAD

Element images now display correctly

 

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost