Some AutoCAD commands (such as TRIM, EXTEND, and FILLET) require the user to specify a pick point as well as the object itself.
Object and point data can be passed to the command and command-s functions without the use of a PAUSE, but requires you to first store the values as variables. Points can be passed as strings within the command and command-s functions, or can be defined outside the function and passed as variables, as shown in the following example.
The following example code demonstrates one method of passing an entity name and a pick point to the command function.
(command "._circle" "5,5" "2") ;Draws a circle (command "._line" "3,5" "7,5" "") ;Draws a line (setq el (entlast)) ;Gets the last entity ; added to the drawing (setq pt '(5 7)) ;Sets the trim point (command "._trim" el "" pt "") ;Performs the trim
If AutoCAD is at an idle Command prompt when these statements are called, AutoCAD performs the following actions: