- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Thank you a lot for helping me.
I have this lisp, that creates different shapes of cups, but i want to replace circles to squares. With the intention to have a lisp that creates different shapes of towers.
;lisp that makes cups but i want to change to a tower
(defun c:tower ()
(setq pontos2d (getvar "osmode"))
(setq pontos3d (getvar "3dosmode"))
(setvar "osmode" 0)
(setvar "3dosmode" 0)
(command "ucs" (getpoint "Insert point. ") "")
(setq nu 0)
(command "_circle" (list 0 0 0) 1) ;first circle
(guardar)
(command "_circle" (list 0 0 (alea 1 2)) (alea 1 4))
(guardar)
(command "_circle" (list 0 0 (alea 2 7)) (alea 1 1.5))
(guardar)
(command "_circle" (list 0 0 10) 1.5) ;last circle
(guardar)
(solido)
(setq lista nil)
(setvar "osmode" pontos2d)
(setvar "3dosmode" pontos3d)
(command "ucs" "")
)
(defun guardar ()
(setq lista (append lista (list (set (read (strcat "entidade" (rtos nu))) (entlast)))))
)
(defun solido ()
(command "loft" "_mo" "_su")
(foreach p lista (command p))
(command "" "")
)
(defun alea ( min max / )
(+ min (valor (- max min)))
)
(defun valor (num)
(* num (rnd))
)
(defun rnd (/ modulus multiplier increment random)
(if (not seed)
(setq seed (getvar "DATE"))
)
(setq modulus 65536
multiplier 25173
increment 13849
seed (rem (+ (* multiplier seed) increment) modulus)
random (/ seed modulus)
)
)
Solved! Go to Solution.