I have been trying hard for couple of days to load a CUIX file through Autoloader mechanism using a “.bundle” file. After few unsuccessful attempts I could succeed, but the images of the ribbon items loaded by the CUIX have a big question mark on them (i.e. the images that I had supplied was not loaded) as shown below:
I had used a sample provided in one of the Autodesk blogs to create the .bundle package.
The folder structure of the .bundle package is as below:
+%AppData%\Autodesk\ApplicationPlugins \---Sample.bundle | PackageContents.xml | \---Contents | add.lsp | \---Resources Sample.cuix Sample.dll
The following is the content of the PackageContent.xml:
<?xml version="1.0" encoding="utf-8"?> <ApplicationPackage SchemaVersion="1.0" ProductType="Application" Name="Spiro" AppVersion="1.1.0"> <Components> <ComponentEntry AppName="ADNPlugin-Spiro" ModuleName="./Contents/add.lsp" AppDescription="ADD" LoadOnCommandInvocation="True" LoadOnRequest="True"> <Commands GroupName="ADDPLUGINS"> <Command Local="CuiTest" Global="SPI" /> </Commands> </ComponentEntry> <ComponentEntry AppName="ADNPlugin-Spiro" AppType="CuiX" ModuleName="./Contents/Resources/Sample.cuix" /> <ComponentEntry AppName="ADNPlugin-Spiro" AppType="Dependency" ModuleName="./Contents/Resources/Sample.dll" /> </Components> </ApplicationPackage>
The CUIX and its resource DLL were taken from another installation where these were working well.
While I was trying to get the images loaded, I stumbled upon a registry key names "ACAD" in the following location:
HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R20.0\ACAD-E001:409\Profiles\<<Unnamed Profile>>\General
When I appended the full path of the sample.dll in the value, AutoCAD successfully displayed the images in the ribbon panels.
It is surprising for me about this behaviour. What is the recommended procedure to load a CUIX file where the images of the riboon items are stored in a resource DLL. My practice and first assumption is to name both CUIX and DLL with same name and place in same folder. But as I said already it does not seem to work, unless I append the path of the DLL in a registry key.
Adding the path to the registry key negates the purpose of using AutoLoader. Hence I persume there must be some elegant way to do this. Can any one recommed such a way?
Many thanks,
Narayanan
Solved! Go to Solution.
Solved by Balaji_Ram. Go to Solution.
Hello Narayanan,
It is not required to set up the path in the registry.
The registry key that you mention is used by AutoCAD for storing support paths configured in the Options dialog.
AutoCAD copies the cuix and resource dlls to "%USERPROFILE%\appdata\roaming\autodesk\autocad 2015\r20.0\enu\support" from the bundle folder and loads it from there. So it is only required to ensure that AutoCAD find this path as one of the support paths.
If this path is already set, and it still does not work, then let me know.
I will share a sample bundle that uses a resource-only dll in its cuix.
I remember having tried this in the past and it had worked ok.
Regards,
Balaji
Thanks Balaji Ramamurthy for your input.
I could see the path %USERPROFILE%\appdata\roaming\autodesk\autocad 2015\r20.0\enu\support in AutoCAD's options dialog under "Support file search path" and still my ribbon panels are filled with defualt images.
Please let me have your sample CUIX and resource DLL and .bundle. Probably I might get some clue.
Many thanks again,
Narayanan
Other than a mismatch in the dll name, I do not see any other reason, why AutoCAD would not copy the resource dll.
I have attached a sample bundle that worked ok in AutoCAD 2015.
You can give it a try.
Regards,
Balaji
Dear Balaji
Hi
Im struggling too hard to make add a customized tab with a bunch of buttons which when clicked on each would run a .dll file to do some task.
so far by reading Autodesk blogs and forums I think the best approach is to create that tab and panels and buttons, save the CUIX file and then create an xml file to make it load. am I right?
if so, how can that be done?
you attached a sample xml to your post. I downloaded it and pasted the .bundle file in application plugins. but I couldnt find out if anything changed in the ribbon bar or not.
I was hoping to see some sort of new tab but nothing appeared.
can you please give me a hand in creating the xml file and explaining to me how it works?
thanks in advance.
your help is very much appreaciated!