AutoCAD Lisp Routines(macros) & Command Free Lisp Routines(macros) Free Lisp Routines and Shortcuts Commands that keep your work easy and fast that boost your working performance while working on Survey Drawing. 8/28/2014 More on www.SurveyDrawing.net Contents by Category 1. Miscellaneous 6. Layer - On Off 8. Layer - Free Thaw 9. AutoLISP Debugger for AutoCAD R13c4 (free LISP debugger) AutoLISP Debugger for AutoCAD R14 (free LISP debugger) 40kB: AutoLISP Debugger for IntelliCAD (free LISP debugger) 45kB: 11.2.2001: BANA - make all block attributes non-annotative (LISP for AutoCAD) 1292:: BlkAnnot - change the Annotative flag for selected blocks (VLX Lisp.
Executes an AutoCAD command
Supported Platforms: Windows and Mac OS
Signature
Type: Integer, Real, String, or List
AutoCAD commands and their options.
The arguments to the command function can be strings, reals, integers, or points, as expected by the prompt sequence of the executed command. A null string (') is equivalent to pressing Enter on the keyboard. Invoking command with no argument is equivalent to pressing Esc and cancels most AutoCAD commands.
Remarks
The command function evaluates each argument and sends it to AutoCAD in response to successive prompts. It submits command names and options as strings, 2D points as lists of two reals, and 3D points as lists of three reals. AutoCAD recognizes command names only when it issues a Command prompt.
Note that if you issue command from Visual LISP on Windows, focus does not change to the AutoCAD window. If the command requires user input, you'll see the return value (nil) in the Console window, but AutoCAD will be waiting for input. You must manually activate the AutoCAD window and respond to the prompts. Until you do so, any subsequent commands will fail.
The AutoCAD SKETCH command reads the digitizer directly and therefore cannot be used with the AutoLISP command function. If the AutoCAD SCRIPT command is used with the command function, it should be the last function call in the AutoLISP routine.
Also, if you use the command function in an .lsp or .mnl file, it should be called only from within a defun statement. Use the S::STARTUP function to define commands that need to be issued immediately when you begin a drawing session.
For commands that require the selection of an object (like the AutoCAD BREAK and TRIM commands), you can supply a list obtained with entsel instead of a point to select the object.
Commands executed from the command function are not echoed to the command line if the AutoCAD CMDECHO system variable (accessible from setvar and getvar) is set to 0.
With the introduction of the Action Recorder in AutoCAD 2009, commands were given versions. Commands used at the Command prompt always use the latest version of the specific command. However, commands used in AutoLISP and command macros might work differently. The initcommandversion function is used to determine the version of the next command to be executed.
Examples
Best Lisp Routines For Autocad
The following example sets two variables pt1 and pt2 equal to two point values 1,1 and 1,5. It then uses the command function to issue the AutoCAD LINE command and pass the two point values.