Free AutoLISP and Visual LISP code snippets for AutoCAD

Please feel free to be inspired, cut&paste or if you have any feedback, questions or looking for an AutoLISP programmer for small or large projects go here. If you want some customization or anything else that you can come up with that we might help you with you're welcome to contact us.

If you look for an app that can load AutoLISP files from your library take a look at our app JTB Lisp.

AutoLISP / Visual LISP

AutoLISP is based on the LISP programming language. Because AutoCAD has a built-in LISP interpreter, you can enter AutoLISP code at the command prompt or load AutoLISP code from external files. Visual LISP (VLISP) is a software tool designed to expedite AutoLISP program development. AutoLISP and Visual LISP is often used mutually but AutoLISP is only a subset of Visual LISP. Visual LISP was incorporated into AutoCAD 2000 released in March 1999, as a replacement for AutoLISP.

Visual LISP technology is a tool for code creation in the AutoCAD software application. It is a full-featured, interpretive programming language that you can use to call AutoCAD commands, system variables, and dialog boxes. Visual LISP offers a complete development environment, including

Reduced development time using the integrated development environment (IDE), which makes it easier and faster for users and developers alike to create, debug, and deliver AutoLISP-based applications

Access to Microsoft ActiveX objects and event reactors

Source code protection against theft and alteration

Operating system file-operation functions

LISP function extensions for list processing

In February 2018, BricsCAD V18.2 came with BLADE, the BricsCAD LISP Advanced Development Environment. See this blog post.

LISP is used by CAD applications like AutoCAD, BricsCAD, DraftSight, GstarCAD, CADopia, IntelliCAD, progeCAD and ZWCAD.

Visual LISP example how to delete all empty layouts (tabs). If the layout has been activated it will contain a viewport object and will not be deleted by this function.

In previous version (= nil (ssget "x" (list (cons 410 (vla-get-name layout))))) was used but did not catch layouts where the viewport object has been deleted. vla-get-count will return 0 for non activated layouts and 1 for a layout with no objects.