Glad to finally find you guys. I have been looking ever since Cadalog shafted the forum site.
Can anyone tell me what is wrong with the below code. I am trying to make it easier to cog reinforcing bars in plan, and I found this old lisp.
(defun C:COG ( / BAR COGDIR)
(setvar "cmdecho" 0)
(LATEST)
(setq COGDIR (UANGLE 1 "Up Down" "Up Down" NIL NIL))
(cond
((= COGDIR "Up")(setq COGANG 90))
((= COGDIR "Down")(setq COGANG 270))
)
(setq BAR 0)
(while
(setq BAR (entsel "\nSelect BAR:"))
(if (not (= BAR nil))
(DRAWCOG)
);end if
);end while
(setvar "cmdecho" 1)
(princ)
);end defun
(defun DRAWCOG ( / BANG COGANG2 P1 P2)
(setq P1 (osnap (cadr BAR) "quick,NEA"))
(setq P2 (osnap (cadr BAR) "quick,END"))
(setq BANG (RTD (angle P1 P2)))
(if (and (> BANG 90)(<= BANG 270))
(setq BANG (+ BANG 180))
)
(setq COGANG2 (+ BANG COGANG))
(COMMAND "PLINE" P2 (POLAR P2 (dtr COGANG2) 300) "")
(command "pedit" (entlast) "j" (car bar) "" "X")
);end drawcog
Thanks in advance.