I am now maintaining an existing plugin that came with a few lisp files in the MyPlugin.bundle folder. These get AutoLoaded it seems, as I dont see any reference to them in the PackageContent.xml file or anything. I can make changes to those lisp files while keeping the names of the files the same and the changes will be reflected when I load AutoCAD.
But I have created a brand new lisp file for a new command, and it is in the same location as the other lisp files. But the new one is not AutoLoading?
I'd like to have it AutoLoad so that when I distribute the plugin to the others in my department, they dont have to do anything extra.
I wasn't sure if adding the lisp file in the custom cui (also part of the plugin) would work given how complicated file paths can be.
Thanks!
Solved! Go to Solution.
Solved by nshupeFMPE3. Go to Solution.
See if you don't have lines of code like below.
(autoload "FileLspWithoutExtention" '("Command1" "Command2"))
https://documentation.help/AutoLISP-Functions/WS1a9193826455f5ff1a32d8d10ebc6b7ccc-6a96.htm
or a line of code (load "file.lsp")
Didier LOURDELLE, Formateur & Développeur ADN Autodesk
AutoCAD LT, AutoCAD, AutoCAD Electrical, Revit
VB.net, Visual Lisp, VBA
MNL files work great for loading lisp for a command in a CUIX file. Keep in mind many of the CUIX files installed with AutoCAD products already come with MNL files that may be overwritten by an update. I wouldn't recommend going that route unless you're adding that MNL file for your own custom CUIX file. Create an acaddoc.lsp file (if you don't have one) which automatically loads in any drawing you open and load your lisp in it.
I have spent to many years with Acad and just do not add anything to acad & acaddoc.lsp or use any mnl, same as I dont edit the acad.cui's the cui editor is a pain much easier just making custom menu's with notepad, the Ribbon unfortunately was not exposed as a mnu. You can though unpack a cuix just copy and rename to .zip you may be surprised what is in the zip.
The entanglement of the Ribbon is like 4 xml files rather than just one, have looked at doing a lisp to create.
I liked working with MNU files from versions r12 thru 2005 and found editing the CUI files in 2006 frustrating. Civil 3D workflows weren't added to the ribbon until version 2011 but the many advantages of using the ribbon convinced me to adjust to using the CUI interface for customization.
I mostly use acaddoc.lsp for checking system variables and setting modemacro for information displayed on the Status Bar and only preload a handful of lisp routines. Most are loaded when the macro commands are called or by autoload.