|;Use the DEFUN ('define function') command in Visual LISP to create an AutoCAD command.
The C: stands for "Command" because you're creating an AutoCAD command. You use C: to
run it from the command prompt. If you leave out the C:, you'd have to execute the LISP
routine by putting parentheses around it (too much work).;|
|;You put the new command name after the (C:) so C:ZP will create a command called ZP.
This should be a name that hasn't already been assigned to an existing AutoCAD command.
Remember that LISP routines beat out the existing AutoCAD aliases. So if you create a LISP
command called E that executes the ELLIPSE command, E will no longer perform an ERASE.;|
|;At the end of the first line of code you'll see an open and close parentheses. These are
essential to the code. They are used when arguements and/or local variables are rquired.;|
(defun c:zp()
(comand "zoom" "p")
)
;--------------------------------------------------------------
|;So how do we tell Visual LISP to hit ENTER? A pair of double quotes will do.
For those of you who have customized menus, this is the equivalent of using a
seimicolon (;) to represent an ENTER.
(defun c:ZAP()
(command "erase" "all" "")
)
(defun c:EA()
(command "erase" "all" "")
)
;my effort EL is ellipse so make ELL elipse in acad.pgp 'pigpen' file
(defun c:EL()
(command "erase" "L"
;--------------------------------------------------------------
|;So how are we going to create a square? We'll execute the POLYGON command,
make the object four-sided, select the EDGE option, and pause twice to let
the user pick the two corners that will make up our square. If you're lost,
go into the POLYGON command and go through all of these steps manually;|
|;Using pause in a Visual LISP will instruct the program to wait for user input.
Those two pauses will enable the user to pick the two corners of the square.
This is equivalent of the backslash \ in menu customization.;|
(defun c:SQ ()
(command "polygon" "4" "e" pause pause)
)
;-------------------------------------------------------------------
               (
geocities.com/wpsmoke/acadalisptrng)                   (
geocities.com/wpsmoke)