RustyWa,
I'm not sure what the original program was intended to
do, but if you change it slightly.. runs better.
(defun CIRCTRIM (PNT1 PNT2 / BRK-ANG D1 Pc CNT SS1 CIRC-ENT O-BMODE O-PBOX)
;; Degrees to Radians, Radians to Degrees
(defun dtr (d) (* pi (/ d 180.0)))
(defun rtd (r) (* 180.0 (/ r pi)))
(setq BRK-ANG (angle PNT1 PNT2)
D1 (distance PNT1 PNT2)
Pc (polar PNT1 BRK-ANG (* 0.5 D1))
CNT (fix (max 8 SF))
CNT (fix (min CNT 12)))
(command "CIRCLE" Pc "D" D1)
(setq SS1 (ssget Pc))
(if SS1 (progn (setq EX-ENT (ssname SS1 0)) (redraw EX-ENT)))
(setq CIRC-ENT (entlast)
O-BMODE (getvar "BLIPMODE")
O-PBOX (getvar "PICKBOX"))
(setvar "BLIPMODE" 0) (setvar "PICKBOX" 2)
(command "TRIM" CIRC-ENT "" Pc "")
(repeat CNT
(setq Pt (polar Pc BRK-ANG (* 0.125 D1)))
(command "TRIM" CIRC-ENT "" Pt "")
;; (setq BRK-ANG (+ BRK-ANG (/ (* 360.0 dr) CNT))))
(setq BRK-ANG (+ BRK-ANG (/ (dtr 360.0) CNT)))
); repeat
(setvar "BLIPMODE" O-BMODE) (setvar "PICKBOX" O-PBOX)
(entdel CIRC-ENT)
(princ)
)
I added new functions for 'dtr' and 'rtd' .. Degrees to radians,
and Radians to degrees, replaced the 'dr' with:
(dtr 360.0), which returns PI.
It might be helpful if you would prepare a simple .dwg, zip it up
and attach to this posting... to show 'before' and 'after' running
this Lisp.. make a couple of notes in there..
Maybe we can come up with a better (updated) version of
lisp program to do the same result..
Bob