command
(command command_string [argument ...] )
Use the command function to execute one or more built-in commands.
Example: (command "_line" "0,0" "1,0" "") .
The arguments passed to the function are evaluated and sent to the command interpreter as responses to the command prompts.
You can call Lisp expressions inside of a command expression. This lets you, for example, retrieve user input.
Example: (command "_move" (entsel "Specify entity: ") "" p1 "1,1")
A null string ("") is equivalent to press the Return key in a command prompt (as shown in the example above).
The parameters provided in the command function do not necessarily have to be complete to entirely terminate the command invoked. In this case, the command execution continues to accept further user input until the command sequence is finished.
Example: The command expression (command "_line" "0,0") starts the Line command and specifies the coordinates 0,0 as the starting point. The other points to draw line segments will be specified by the user.
The system variable CMDECHO controls prompt display when executing the command:
- If the system variable CMDECHO is set to 1, the Command Window displays the command(s) executed, the prompts of the built-in command(s), and the responses specified within the function.
- If the system variable CMDECHO is set to 0, the Command Window does not display prompts.
Return Value
The function always returns nil.
: (command "_line" pt1 "10,15" "")
: (command "_move" (entsel "Specify entity:") "" "0,0" "1,1")