This dialog will appear :
Select "Expert" mode as we want to compile multiple file types, and then press "Next" :
Enter the path to the directory you would like to store the files in. Select the same directory that you stored the AutoLISP source files.
Then, give your application a name. It does not have to be the same as your AutoLISP source file, but to spare any confusion, let's keep it the same.
The select "Next" :
No, we do not want our application to run in a separate namespace.
Just select "Next" :
Now we need to select our AutoLISP source file. Select "refl.lsp" then press "Next" :
In this dialog, we select and add any dependency files that our application needs to run correctly. Select "refl.dcl" and then "Next" :
No need to confuse you now, just go with the "Standard" option. Select "Next" :
OK, that's us about done. To build your compiled application, just select "Finish".
VLisp of AutoCAD executes instructions in a Make file to build an application. Output messages from this process appear in two VLisp of AutoCAD windows: the Build Output window and the Console window. The Build Output window contains messages relating to any compilation of AutoLISP source code into .fas files. In a successful compile, the output looks like the following :
; (COMPILE-FILES st (D:/drawings/refl.lsp))
[Analyzing file "D:/drawings/refl.lsp"]
..
......
[COMPILING D:/drawings/refl.lsp]
;
;;C:REFL
;CCC
;;MKLIST
;;SPINBAR
;;INITERR
;;TRAP
;;RESET
;
[FASDUMPING object format -> "D:/drawings/refl.fas"]
; Compilation complete.
The compiler messages identify the following items:
- The name and directory path of the source files being compiled.
- The functions defined in the source file. Seven functions are identified: C:REFL, CCC, MKLIST, SPINBAR, INITERR, TRAP and RESET.
- The name and path of the output .fas files.
The VLisp of AutoCAD Console window displays messages relating to the creation of the application executable, the .vlx file. If the Make Application process succeeds, the Console window displays the path and file name of the .vlx, as in the following example:
VLX-Application packed D:/drawings/refl.VLX
_$
Have a look in the directory where you stored the source files. You should now have 5 "refl" files :
- refl.lsp - AutoLISP source file
- refl.dcl - DCL source file
- refl.fas - Compiled AutoLISP Program
- refl.vlx - Executable Visual Lisp Module
- refl.prv - Application Make file.
You can now distribute "refl.vlx" as a compiled application.
Note!!! You CANNOT edit a vlx file. These 5 files need to be kept in a safe location if you intend to edit or revise your vlx file.
Loading Compiled AutoLISP Applications :
Loading compiled applications is exactly the same as for normal AutoLISP functions :
(load "refl")
Here's a couple of things to keep in mind :
If you do not specify a file extension, load first looks for a file with the name you specified (for example, "refl"), and an extension of .vlx. If no .vlx file is found, load searches next for a .fas file, and finally, if no .fas file is found, load searches for a .lsp file.
Tip of the Day :
To aid you in the process of maintaining multiple-file applications, VLisp of AutoCAD provides a construct called a Project. A VLisp of AutoCAD Project contains a list of AutoLISP source files, and a set of rules on how to compile the files.
Using the Project definition, VLisp of AutoCAD can do the following :
- Check which .lsp files in your application have changed, and automatically recompile only the modified files. This procedure is known as a Make procedure.
- Simplify access to source files by listing all source files associated with a project, making them accessible with a single-click.
- Help you find code fragments by searching for strings when you do not know which source files contain the text you're looking for. VLisp of AutoCAD limits the search to files included in your project.
- Optimize compiled code by directly linking the corresponding parts of multiple source files.
Have a look at the Visual Lisp Help for further information on Projects.
|