Be warned, this is a little Rouba Goldberg. but it works!
I will demonstrate using Autocad 2014.
First you need to create an Autocad Script file containing some undocumented commands. I called my build.scr
(Note that vlisp-compile-list not documented anywhere. If you find any documentation, please let me know!)
vlide ( vlisp-compile-list 'st ( list (strcat (getenv "UserProfile") "\\Documents\\AutocadFiles\\gui.lsp")) ... ) (strcat (getenv "UserProfile") "\\Documents\\AutocadFiles\\CompiledLisp.fas") )
Then create a batch file containing this:
@echo off cd c:\Program Files\Autodesk\AutoCAD 2014 start acad.exe /b build.scr
It launches AutoCAD and runs the specified script
Next, you will need to download and install AutoHotKey
and build a Script like this for him:
Run, BuildLisp.bat sleep, 30000 WinActivate, Autodesk AutoCAD 2014 - [Drawing1.dwg] WinActivate, Visual LISP for AutoCAD <Drawing1.dwg> WinActivate, Autodesk AutoCAD 2014 - [Drawing1.dwg] sleep, 10000 WinClose, Autodesk AutoCAD 2014 - [Drawing1.dwg]
When you activate this script. It should open AutoCAD and collect all your LSP files into one .FAS, then close.
Doubts for a note. The Visual LISP editor must be open for compilation. Compilation will be performed only when the window is activated.
If someone finds a better way. PLEASE LET ME KNOW!