Time to respond to another piece of mail, <swish swish> this one comes from the middle of the bag and has a question about sharing CUI files, but mainly with sharing those cool icons that someone spent time making for their custom commands. The issue is that when associating images to a command in the Customize User Interface editor, by default the images that are assigned to a command in CUI are listed as absolute paths which doesn't work the best when sharing CUI files with custom images; especially if a change is made to the CUI file after you gave them the MNR file.
The best solution when creating a custom command is to only have the file name and extension in the Small Image and Large Image fields, instead of the absolute path to the file. If the images don't reside in the specific spot called out in the CUI file, AutoCAD gets rather confused (meaning the Clouds with a Question Mark appears on the toolbar for the commands that have missing icons). Below are a few rules to go by to help avoid the dreaded "Cloud of Mystery" icon in AutoCAD when sharing customization files, at least its not the sinister looking smiley any more; curse you Mr. Smiley and those sunglasses of yours.
Rules to go by when assigning icons to custom commands:
- Assign the image using just the file name and extension, and if you want to you can also use relative paths as well. AutoCAD simply searches all of its support paths based on the file name and/or relative path that is provided with the assigned image.
The Icons folder that is mentioned above is an Icons folder that is located under a support path that is already part of AutoCAD's Support File Search Path.
- Place the images in a safe place other than your My Documents folder. Usually on a networked location if you are sharing the CUI file with multiple individuals or if you work by yourself you can place the images in a specific folder so you can migrate them easily to a future release, such as Icons under C:\Documents and Settings\<user name>\Application Data\Autodesk\AutoCAD 2007\R17.0\enu\Support. If you place your images in a folder other than Icons, make sure to add the path to AutoCAD's Support File Search Path under the Files tab of the Options dialog box.
- Alternatively, you can create a resource DLL that contains the images that are specific to your CUI file. If you create a resource DLL for your menu, it should be placed in the same directory as your menu and have the same name. So if your CUI file is named MyCUI.cui, the resource DLL should be named MyCUI.dll. There are many ways to create the resource DLL, but commonly they are created with Visual Basic or Visual C++.
These changes to the way you assign and manage your images for custom commands will help when sharing customization files and make migrating much easier for future releases.