Author Topic: extrusion code  (Read 4827 times)

0 Members and 1 Guest are viewing this topic.

Zahex

  • Guest
who's CAB?
« Reply #15 on: May 12, 2005, 08:52:30 AM »
who's CAB?

daron

  • Guest
extrusion code
« Reply #16 on: May 12, 2005, 09:27:23 AM »
Charles Alan Butler? A very good guy who learned a lot about lisp through forums like this and does a lot to return the favor by helping others.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10395
extrusion code
« Reply #17 on: May 12, 2005, 09:42:31 AM »
Thanks guys.
I did not see problem with the code & it worked for me in ACAD2000.
Here are some changes I would make though. Mostly the use of getdist to
replace getreal. Also localized the functions
Code: [Select]

(defun c:2 (/ usercmd useros radius height angDeg sides centerpt baseradius
            dtr rtd)
  (defun dtr (a) (* pi (/ a 180.0)))
  (defun rtd (a) (* 180.0 (/ a pi)))
 
  (command "._undo" "_begin")
  (setq usercmd (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
  (setq useros (getvar "osmode"))
  (if (and
        (setq radius (getdist "\n larger radius: "))
        (setq baseradius (getdist "\n smaller radius: "))
        (setq height (getdist "\n height: "))
        (setq angDeg (- 90.0 (rtd (atan height (- radius baseradius)))))
        (setq sides (getint "\n number of polygon sides: "))
        (setq centerpt (getpoint "\n insertion point: "))
      )
    (progn
      (setvar "osmode" 0)
      (command "._polygon" sides centerpt "_C" radius)
      (command "._extrude" (entlast) "" height angDeg)
    )
  )
  (setvar "osmode" useros)
  (setvar "CMDECHO" usercmd)
  (command "._undo" "_end")
  (princ)
)
(prompt "\nRoutine 2 Loaded, Enter 2 to run.")
(princ)
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Zahex

  • Guest
extrusion code
« Reply #18 on: May 12, 2005, 09:48:55 AM »
nice to meet you CAB.You have lots of people who trust your work,that's very nice.
2 questions:
1-what does "CMDECHO" means?
2-can you take a look at my other post called 2 codes fusion ant tell me what you think about it?

thanks all of you

CAB

  • Global Moderator
  • Seagull
  • Posts: 10395
extrusion code
« Reply #19 on: May 12, 2005, 09:57:44 AM »
Welcome to the Swamp :)
Quote
CMDECHO - system variable
Type: Integer
Not saved
Initial value: 1
Controls whether AutoCAD echoes prompts and input during the AutoLISP command function.

0   Turns off echoing
1   Turns on echoing


I'll look but I'm a 2d kinda guy, that 3d hurts my head. :shock:
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

daron

  • Guest
extrusion code
« Reply #20 on: May 12, 2005, 09:58:13 AM »
1 - CoMmanDECHO. It echo's (prints) the return values of commands to the command line.

Zahex

  • Guest
extrusion code
« Reply #21 on: May 12, 2005, 10:40:10 AM »
now...who's a 3d kind of guy that can give me some help in the merge of  2 routines ...?

Thanks

CADaver

  • Guest
extrusion code
« Reply #22 on: May 12, 2005, 10:51:24 AM »
well i'm a 3d kinda guy, but my lisp capabilities stink.  i'll take a look at that other thread, but i ain't making any promises.

Zahex

  • Guest
extrusion code
« Reply #23 on: May 12, 2005, 10:52:51 AM »
Thanks CADaver!