CAD Studio - CAD/CAM/GIS/BIM/PLM solutions
English Deutsch Cesky Slovensky Magyar

AutoExec enabler - embed LISP macros in AutoCAD DWGs

Store and automatically load/execute LISP macros from DWG drawing files


AutoExec - embed macros inside DWG files

AutoExec enabler is a VisualLISP utility for AutoCAD (2004 and higher). It allows to store LISP macros inside DWG drawing files and load or execute them automatically on any Open of the particular DWG file.

The AUTOEXEC command can store any LSP/VLX/FAS file into the current drawing. Do not use it to store large AutoLISP/VisualLISP programs. To automatically run any macro embedded in a DWG file, you will need to have the AutoExec.vlx "enabler" loaded everytime and everywhere (e.g. by dragging to the briefcase icon in _APPLOAD). Then you don't need to install a specific macro on each workstation, just have it embedded in the opened DWG drawing.

AutoExec

To insert a new macro, use the button "Load macro" and then click "Add". As a protection against possible foreign malicious macros, you can set AutoExec to load and run only your own macros (saved from the same Windows login) - they are marked with an "*" in the list (any change in the code will "unsign" the macro). The "Update" button updates just the command name to run (if any) and its loading options. If you want to update the macro code, delete the macro and add a new one.

Sample:

Try AutoExec e.g. with the TalkingDWG drawing - open it when AutoExec is loaded and then enter any unknown command (have foreign macros enabled in AutoExec options - "just my" disabled). And switch your speaker on.

Usage:

AutoExec.vlx (the enabler) must be always loaded - e.g. using the briefcase mechanism in APPLOAD, or using CUI, or by adding the line:

(load "APPLOAD.VLX")

to your ACAD.LSP or ACADDOC.LSP.

Use the "Exec Command" to start a command (perhaps defined by the loaded macro) after you open the DWG drawing - i.e. not only load the macro.

The ON/OFF state and running foreign macros option are stored in the Registry (per computer/user). You can store up to 9 macros in your DWGs. Any of them can be individually enabled or disabled or set to "Ask to load" - these settings are stored along with the macros inside the DWG file.

The stored macros are completely transparent for standard AutoCAD commands, for processing in AutoCAD LT, during up/down migration of DWG files, or in AutoCADs without AutoExec loaded.

Embedding a 10kB macro file adds about 10kB to your DWG size.

To avoid the "secure load" warning of unsigned macros, add the temporary AutoExec folder to your AutoCAD's "trusted path" settings. The folder is located by default at:

%ROAMABLEROOTPREFIX%\AutoExec" - e.g.:
C:\Users\USERNAME\AppData\Roaming\Autodesk\AutoCAD 2016\R20.1\enu\AutoExec

You can preset its location by setting the _AE_safefolder variable:

(setq _AE_safefolder "C:\\MyFolder\\")

History

  • 1.0 - first release (2015 Christmas tools)

Freeware License

AutoExec is a free utility by CAD Studio, do not publish it online on other than CADstudio's web servers. Contact CAD Studio for feature enhancements.


Download the AutoExec application (for AutoCAD 2022-2004)


Facebook Twitter YouTube LinkedIn
© 2021 CAD Studio s.r.o. (Arkance Systems) | contact | webmaster | privacy