Build Automation for AutoCAD Lisp Files

I have a huge LISP project, I created a prv file that allows VLIDE compile this project into a single vlx file (it also compiles fas file). The problem is that it is not possible to compile the project from outside the autoframe or from the command line, so I cannot automate the building of vlx using a script.

Question: is there any way to do this? Can I compile fas-vlx from outside AutoCAD? Or can I run autocad by giving a script that compiles prv and then closes the autocad?

+6
source share
4 answers

You have to run AutoCAD, but even this becomes difficult, as this requires undocumented features .

+1
source

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!

+1
source

I did something, you checked this link

http://www.thefreecountry.com/compilers/commonlisp.shtml

0
source

If optimization and source protection are a common goal, here is an open source project that will take care of this:

http://www.lt-extender.com/LT-Extender/englisch/default.htm

0
source

Source: https://habr.com/ru/post/950693/


All Articles