Author Topic: Multiple functions  (Read 2063 times)

0 Members and 1 Guest are viewing this topic.

hudster

  • Gator
  • Posts: 2848
Multiple functions
« 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.
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

hendie

  • Guest
Multiple functions
« Reply #1 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.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Multiple functions
« Reply #2 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?
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie