0% found this document useful (0 votes)
70 views

Vlisp Variables

This document provides a tip for finding all the variables used in an AutoCAD Lisp routine. It explains how to use the "Check Edit Window" tool to generate a list of global variables, which can then be copied and pasted into the Lisp code to declare them as local variables. Declaring variables this way is useful for organizing large routines with many variables.

Uploaded by

Fernando Holanda
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

Vlisp Variables

This document provides a tip for finding all the variables used in an AutoCAD Lisp routine. It explains how to use the "Check Edit Window" tool to generate a list of global variables, which can then be copied and pasted into the Lisp code to declare them as local variables. Declaring variables this way is useful for organizing large routines with many variables.

Uploaded by

Fernando Holanda
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

CAD Panacea

Ok, so this isn't a cure all for CAD, but all the other cheesy CAD blog names are taken....

Autocad Drawing Engineering Base LISP Generator (autocad)


At Art Instruction Schools Free Online Art Next generation of Electrical CAD. Get your Create any custom AutoLISP program without
Test! free trial version! writing any code. It's easy
ArtInstructionSchools.com www.engineeringbase.com www.lispgen.com

VLISP VARIABLES

Here is a tip on how to find all the variables in your lisp file. You can use this tip on existing lisp
functions or on new ones you are writing.

Normally when you are in the middle of writing a routine, you may not take the time to declare
local variables as you add them to your code. In fact, if you are testing and debugging you may
want the variables to remain global. When you are ready though, there is an easy way to gather up
all the variables used in a function.

First, lets look at an existing function in the Visual Lisp Editor (VLIDE).
[Note: this sample code was taken from the Visual Lisp help file]

Right after the defun statement, there are two parenthesis. These parenthesis are used to contain
arguments and local variables. An empty set are still required even when you don't have either
item.

In the VLIDE, go to the Tools menu, then choose Environment Options, then General Options.
Switch to the Diagnostic tab and make sure that "Report statistics during syntax checking" is
toggled ON.

Close this dialog. Make sure the window with your code is current in the VLIDE. Now look for the
"Tools" toolbar. Click on the third icon from the left (this should be "Check Edit Window").

After you click this button, the Build Window will appear in the VLIDE. In this window will be a list
of all global variables.

Copy this list of variables, along with the parenthesis, to your code window overwriting the single
Mistress of the Dorkness

pair of parenthesis shown earlier. Add the required "/" character after the first parenthesis and
then add a space after it. (The "/" character separates function arguments from local variables).

The result is shown here.

This was just a small example, but if you ever work on a large routine with dozens of variables, this
tip can really help.

posted: 7/24/2006 06:13:00 PM | PermaLink | 2 comments

You might also like