About Using AutoCAD Commands (AutoLISP) AutoLISP can execute a built-in AutoCAD command or one that is defined in a loaded ObjectARX or Managed.NET application. Note: AutoCAD for Mac does not support Managed.NET applications. The command and command-s functions allow you to start and pass values to an AutoCAD command. AutoCAD lisp files for Blocks & Attributes, Dialog Control, Dimensioning the drawings and editing or modifying drawing geometry, Lisps for autocad Groups, Area and length calculations, level calculationtions, civil and road works projects calculations, viewport settings, MText, Polylines, Selection tools, Spline, Text, Layers and there are many more Miscellaneous autolisp files as well. 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. Of each command. Basic AutoLISP functions are covered in Chapter 27 and Chapter 28 on the companion website. Detailed defi nitions of these and all other AutoLISP commands are found in the online documentation. The func-tion names are shown with their required and optional arguments. Required arguments are shown in square brackets and bold.
AutoLISP can execute a built-in AutoCAD command or one that is defined in a loaded ObjectARX or Managed .NET application.
Note: AutoCAD for Mac does not support Managed .NET applications.
The command and command-s functions allow you to start and pass values to an AutoCAD command. The command and command-s functions have a variable-length argument list. The first argument of these functions must be the command you want to execute. All other arguments must correspond to the types and values expected by that command's prompt sequence; these may be strings, real values, integers, points, entity names, or selection set names. Data such as angles, distances, and points can be passed either as strings or as the values themselves (as integer or real values, or as point lists). An empty string (') is equivalent to pressing the Spacebar or Enter on the keyboard.
The command-s function is faster and more efficient than the command function, but the command being executed within the command-s function must be completed within the same statement. This means that an argument must be provided for each of the command’s prompts, and that it cannot execute any more AutoLISP statements until the function has completed. Unlike the command-s function, you can use AutoLISP functions within the command function and the command that is being executed does not need to be completed to continue execution of the program.
There are some restrictions on the commands that you can use with the command and command-s functions.
The following code fragment shows representative calls to command.
When the CircC command is loaded and executed at the AutoCAD Command prompt, the following actions occur:
The following code fragment shows representative calls to command-s.
The CircCS command is similar to CircC except it prompts the user for a center point and radius before making the last call to the command-s function. With the command-s function, you should avoid the use of the PAUSE token.
Related Concepts
Executes an AutoCAD command
Supported Platforms: Windows and Mac OS
Signature
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |