Hi everyone,
I have a simple LISP script that loads a custom CUI Panel in my ribbon when AutoCAD launches. For context, it also loads a custom plugin, but that is not relevant to my problem. This is the code I use:
CustomRibbonLoader.lisp
(vl-load-com)
(vla-load (vla-get-menugroups (vlax-get-acad-object)) "./CustomRibbon.cuix")
PackageContents.xml
<ApplicationPackage SchemaVersion="1.0" Version="1.0" ProductCode="XXX" ProductType="Application" Name="Custom Plugin" Icon="./Contents/Resources/logo.ico" HelpFile="./Contents/Resources/en-US/plugin.htm">
<CompanyDetails Name="CompanyName" Url="www.url.com" Email="info@info.com" Phone=" " />
<Components>
<RuntimeRequirements OS="Win64" Platform="AutoCAD*" />
<ComponentEntry AppName="Custom Plugin" ModuleName="./Contents/Plugin.dll" AppDescription="Custom App" LoadOnCommandInvocation="True" LoadOnAutoCADStartup="False">
<Commands GroupName="CustomCommands">
<Command Global="COMMAND1" Local="COMMAND1" />
<Command Global="COMMAND2" Local="COMMAND2" />
<Command Global="COMMAND3" Local="COMMAND3" />
</Commands>
</ComponentEntry>
<ComponentEntry AppName="Custom CUIX" Version="1.0.0" ModuleName="./Ribbon/CustomRibbon.cuix" />
<ComponentEntry AppName="Custom CUIX Loader" Version="1.0.0" ModuleName="./Ribbon/CustomRibbonLoader.lsp" PerDocument="True"/>
</Components>
</ApplicationPackage>
This code loads the CUIX in AutoCAD 2020, 2021 ,2022, 2023... but unfortunately, not in 2024. I've tried loading my CUIX file manually with CUILOAD and doing so the panel appeared in the ribbon as always.
I need to load the Pallete Panel automatically when the plugin is loaded, as I will not be able to alter manually the AutoCAD of the plugin users.
Is there any modification I can do to my LISP script in order to make it work with AutoCAD 2024?
Thanks in advance.
Solved! Go to Solution.
Solved by Sea-Haven. Go to Solution.
Have you tried adding this lisp to startup suite content
https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-B38F610B-51FB-4938-BDEC-A0A737F5DB6C
@paullimapa ha escrito:Have you tried adding this lisp to startup suite content
Hey @paullimapa , thanks for the suggestion. I just tried to do so, but it is not working neither...
Also, this solution would not help me, as I need to load the Pallete Panel automatically when the plugin is loaded, as I will not be able to alter manually the AutoCAD of the plugin users... I will include this info in the main post.
In addition to adding the folder to Support File Search Paths did you also add the relevant folders to the trusted folders path?
@paullimapa ha escrito:In addition to adding the folder to Support File Search Paths did you also add the relevant folders to the trusted folders path?
Yeah, I placed the CUIX and the LISP files within the default trusted folder:
C:\Users\user\AppData\Roaming\Autodesk\ApplicationPlugins\CustomPlugin\Ribbon
Have you tried instead of
"./CustomRibbon.cuix")
including the complete path to the location of the cuix?
FYI for your packages.xml to load follow this structure
https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-40F5E92C-37D8-4D54-9497-CD9F0659F9BB
Maybe this example for a method.
(setq Menu_Path "C:\\CAD-TOOLS\\") ; Path to Menu file
(setq Menu_Name "CAD-TOOLS") ; pop menu to load
(setq Group_Name "CADMENU") ; groupname assigned in .mnu or .mns file
(if (menugroup menu_Name)
(command "_MENUUNLOAD" menu_Name)
)
(setq cnt (vla-get-count(vla-get-menuGroups (vlax-get-acad-object))))
(if (> (vl-string-search "BRICSCAD" (strcase(getvar 'product))) 0)
(progn
(command "MENULOAD" (strcat Menu_Path Menu_Name ".cui"))
(menucmd (strcat "P" (rtos (+ cnt 1) 2 0) "=+" menu_Name ".POP1"))
)
(progn
(command "MENULOAD" (strcat Menu_Path Menu_Name ".cuix"))
(menucmd (strcat "P" (rtos (+ cnt 1) 2 0) "=+" menu_Name ".POP1"))
)
)
(alert "\n Menu loaded \n \n CAD TOOLS programs now installed")