TheSwamp

CAD Forums => CAD General => Topic started by: hudster on April 19, 2004, 03:47:34 AM

Title: Multiple functions
Post by: hudster on April 19, 2004, 03:47:34 AM
Is it possible to have more than 1 function in an lisp routine?

I want to set up a lisp so that i can type Z100, Z50, Z200, and autocad will zoom by the scale factor indicated.
Title: Multiple functions
Post by: hendie on April 19, 2004, 03:53:52 AM
yup you can.
you can have as many as you like but it's easier if you keep "like functions" grouped together.
Title: Multiple functions
Post by: Keith™ on April 19, 2004, 06:22:24 AM
you could do something like....

Code: [Select]

(command zfact ( zscale )
 (command "zoom" zscale )
)
(defun C:Z100()
 (zfact 100)
)
(defun C:Z200()
 (zfact 200)
)
(defun C:Z50()
 (zfact 50)
)
(defun C:Z1()
 (zfact 1)
)


How is that?