Few years ago I got this simple AutoLisp Routine and it works very good with AutoCAD v.12, but it doesn't works with AutoCAD 2002. I would be very appreciative to anyone who can answer to me what's wrong with this routine, because I don't know much about Autolisp. ;Opsti dio (defun opstidio ( / zidi zide) (setq dz (getreal " Debljina zida (m):")) (setq sv (getreal " Sirina vrata (m):")) (setq pr (getint " Da li vrata imaju prag (1/0):")) ; 1-da 2-ne (setq ld (getint " Da li su vrata lijeva (1/0):")) ; Bira se linija zida. Tacka izbora postje tacka insertovanja. ; Ujedno se dobija informacija o layer-u zidova (setq zidl (entsel " Tacka insertovanja (na zidu):")) (setq ti (cadr zidl)) (setq zidi (car zidl)) (setq zide (entget zidi)) (setq zidlay (cdr (assoc 8 zide))) (setq ugao (getangle " Dvije tacke za ugao:")) ) ;Pronalazenje odgovarajucih tacaka na zidu i break-ovanje zida (defun br () (command "break" ti t2) (command "break" t3 t4) ) ;Spajanje ivica zida poslije break-ovanja (defun zidovi () (setvar "clayer" zidlay) (command "line" ti t3 "") (command "line" t2 t4 "") ) ;Pronalazenje odgovarajucih tacaka za stokove i crtanje stokova (defun stokovi () (setq t2 (polar ti ugao sv)) (setq ugao1 (+ ugao (/ (* 90 PI) 180))) (setq t3 (polar ti ugao1 dz)) (setq t4 (polar t3 ugao sv)) (setq stolay (getstring " Layer stolarije <STOLARIJA>:")) (if (= stolay "") (setq stolay "stolarija")) (setvar "clayer" stolay) (setq t7 (polar ti ugao 0.05)) (setq t8 (polar t7 ugao (- sv 0.1))) (setq t5 (polar t7 ugao1 (+ (/ dz 2) 0.025))) (setq t6 (polar t5 ugao (- sv 0.1))) ;Lijevi stok (command "line" (polar ti ugao1 (+ (/ dz 2) 0.025)) t5 (polar t7 ugao1 (- (/ dz 2) 0.025)) (polar ti ugao1 (- (/ dz 2) 0.025)) "") ;Desni stok (command "line" (polar t5 ugao (- sv 0.05)) t6 "") (command "line" (polar t2 ugao1 (- (/ dz 2) 0.025)) (polar t8 ugao1 (- (/ dz 2) 0.025)) t6 "") ) ;Crtanje praga (defun prag () (if (= pr 1) (command "line" t5 t6 "" command "line" (polar t7 ugao1 (- (/ dz 2) 0.025)) (polar t8 ugao1 (- (/ dz 2) 0.025)) "")) ) ;Crtanje lijevog krila (defun krilo1 () (setq t9 (polar t5 ugao 0.02)) (setq t10 (polar t9 ugao1 (- sv 0.12))) (setq t11 (polar t5 ugao1 (- sv 0.12))) (command "line" t5 t9 t10 t11 t5 "") (setq ugao2 (+ ugao (/ (* 45 PI) 180))) (setq t12 (polar t9 ugao2 (- sv 0.12))) (command "arc" t6 t12 t10) ) ;Crtanje desnog krila (defun krilo0 () (setq t9 (polar t5 ugao (- sv 0.12))) (setq t10 (polar t9 ugao1 (- sv 0.12))) (setq t11 (polar t6 ugao1 (- sv 0.12))) (command "line" t6 t9 t10 t11 t6 "") (setq ugao2 (+ ugao (/ (* 135 PI) 180))) (setq t12 (polar t9 ugao2 (- sv 0.12))) (command "arc" t10 t12 t5) ) ;Pokazivac za crtanje krila (defun krilo () (if (= ld 1) (krilo1) (krilo0)) ) ;Osa na kojoj se ispisuje sirina i visina vrata (defun osa () (setq t13 (polar ti ugao (/ sv 2))) (command "line" t13 (polar t13 ugao1 sv) "") (command "line" t13 (polar t13 (- ugao (/ (* 90 PI) 180)) 0.15) "") (command "circle" (polar t13 (- ugao (/ (* 90 PI) 180)) 0.26) 0.11) ) ;Glavna funkcija (defun C:VR (/ oldlay oldech oldblp zidl zidlay dz sv ti ugao t2 t3 t4 ugao1 x5 y5 t5 t6 t7 t8 pr ld t9 t10 t11 ugao2 t12) (setq oldlay (getvar "clayer")) (setq oldech (getvar "cmdecho")) (setq oldblp (getvar "blipmode")) (opstidio) (setvar "cmdecho" 0) (setvar "blipmode" 0) ; (br) ; (zidovi) (stokovi) (prag) (krilo) (osa) (br) (zidovi) (command "redraw") (setvar "clayer" oldlay) (setvar "blipmode" oldblp) (setvar "cmdecho" oldech) )