I've created a program to load a partial CUI into another CUI outside of AutoCAD. Per the CUI documentation the code to load a partial cui is:
CustomizationSection maincui = new CustomizationSection(filename);
maincui.PartialCuiFiles.Add(filenameofpartial);
I've left out the checks to see if the partial CUI is loaded.
The partial that I am loaded contains ribbon tabs/panels that have the images for the commands stored in the CUIX file (new 2010 feature). However, when I use the code above to load the partial, the images all show up as clouds. If I load the same ribbon (copied to a different location) through AutoCAD, the images all show up fine.
Partial Fix:
If I extract the images and save them in a folder that is located in an AutoCAD support search path, they will show up correctly.
My conclusion:
I think the CUI API needs to be fixed so that AutoCAD looks for the images inside of the CUIX file. Since the images are not found, I conclude that AutoCAD performs the search to locate them in the CUIX, but the CUI API does not.
Has anybody found a way to load the partial cui files outside of AutoCAD so that the images show up correctly?
I've only found a couple things (none of which work)
1. The Header CUI file (from the extracted CUIX), the partial is listed by the file name only and not the full path.
2. The when load through AutoCAD the full path is stored in the registry in the profile Profilename\Dialogs\Select a file\FilenameMRU.
So I can't find anything in the CUIX file that shows a major difference. I changed the path to only the filename and I tried adding the path to the registry, and the images still were not located. I've used the Process Monitor exe to try to track down and see what happens. I did notice that AutoCAD will use the support file search path to locate the CUIX and load the first one it finds. However, even adding a support file search path to the cuix directory doesn't produce reliable results for loading the images.
My conclusion is that there is a bug in the loading mechanism. It'd be nice to be able to tell AutoCAD to look for images in the CUIX so it wouldn't try to load the from the normal methods. Any other suggestions would be welcome....I'm going bald trying to get this sorted out.