Secrete Behind AutoCAD Success:: Auto Lisp

AutoLISP

AutoLISP is a dialect of Lisp programming language built specifically to be used with the registered version of AutoCAD. AutoLISP is a derivative of LISP (List processing language) where values and expressions are associated dynamically. Using AutoLISP, AutoCAD becomes customizable and hence makes the work faster. Some of the examples of AutoLISP are mentioned below.

AutoLISP programs plays a great role in building menu macros. This is done by writing AutoLISP routines and saving them as an MNL file. It is also possible to use AutoLISP statements as menu macros.

AutoLISP has many predefined functions which allow controlling the programs.

Using AutoLISP many small but time consuming tasks can be finished faster, a few examples are shown below

  • To add a stamp block
  • Insert a title block
  • Update text in the title block
  • Insert text, block or XRef
  • Change text or attribute values
  • Change all external references (XRef) from absolute paths to relative paths for archive purpose.

All AutoLISP files are stored with a .LSP extension.

To load/Unload .LSP files

Load: (load “Path/filename”)

Note: While giving the filename there is no need to give the file extension

FAS (Fast-load AutoLISP) and VLX (Visual Lisp Executables)

FAS and VLX files are compiled AutoLISP files that have been created with Visual LISP. FAS files contain a single compiled AutoLISP routine, whereas VLX files contain multiple routines. FAS and VLX can load and run a Visual LISP program. The difference however, is that a VLX is a stand-alone program, which implies that it is completely self-contained.

Advantages of using VLX files are

  • They provide a single, self-contained file to share.
  • With VLX, symbol exposure is limited and so is technical support time, and hence, end-users cannot manipulate the symbols and damage program execution.
  • VLX files load and run faster than LSP or FAS files.

Object ARX files

An ARX application is a dynamic link library (DLL) that shares AutoCAD’s address space and makes Direct function calls to AutoCAD. Designed with extensibility in mind, the ARX libraries include macros to facilitate defining new classes and offer the ability to add functionality to existing classes in the library at run time. The ARX libraries can be used in conjunction with the AutoCAD Development System (ADS) and the AutoLISP application programming interfaces.

To Load/ Unload ARX files.

Load : (arxload )

Unload : (arxunload)

Note: While giving the filename there is no need to give the file extension

VBA Files (.DVB files)

Microsoft Visual Basic for Applications (VBA) is an object-based programming environment designed to provide rich development capabilities. The main difference between VBA and VB (Visual Basic 6) is that VBA runs in the same process space as AutoCAD, providing an AutoCAD-intelligent and very fast programming environment.

To load VBA files

Load: -vbarun

Note: After entering this the macro name is prompted.

How to Download Set of Free Lisps?