< >一个很好用的画截断线的LISP
(defun c:JDX ()
(setq oldos (getvar "osmode"))
(setq oldpk (getvar "pickbox"))
(setvar "pickbox" 0)
(setvar "osmode" 0)
(setq scal1 (getreal "\nenter the relative <12>:"))
(if (= scal1 nil) (setq scal1 12))
(setq XY1 (getpoint "\nfirst point:"))
(setq XY2 (getpoint XY1 "\nsecnod point:"))
(brkli scal1 XY1 XY2)
(setvar "pickbox" oldpk)
(setvar "osmode" oldos)
)
(defun brkli (scal1 XY1 XY2)
(setq a (angle XY1 XY2))
(setq d (distance XY1 XY2))
(setq XY3 (polar XY1 a (/ d 2)))
(setq XY4 (polar XY3 (- a (* 4 (/ pi 4))) (* (/ d scal1) 1 )))
(setq XY5 (polar XY3 (+ a (* 3 (/ pi 4))) (* (/ d scal1) 1.414)))
(setq XY6 (polar XY3 (- a (* 1 (/ pi 4))) (* (/ d scal1) 1.414)))
(setq XY7 (polar XY3 (- a (* 0 (/ pi 4))) (* (/ d scal1) 1 )))
(command "pline" XY1 "w" "0" "0" XY4 XY5 XY6 XY7 XY2 "")
(setvar "pickbox" oldpk)
(setvar "osmode" oldos)
) </P>
|