这是画虚线部分圆弧的程序,供参考,具体另一部分,许图形的虚线等你自己去做- (defun c:test( / pt1 pt2 entl lpt1 lpt2 ang ptc)
- (setq pt1 (getpoint "pick first point:"))
- (setq pt2 (getpoint "pick second point:"))
- (setq entl (entget (ssname (ssget "c" pt1 pt1 '((0 . "LINE"))) 0)))
- (setq lpt1 (cdr (assoc 10 entl)))
- (setq lpt2 (cdr (assoc 11 entl)))
- (if (equal pt1 lpt1 0.0001)
- (setq lpt2 lpt1)
- )
- (setq ang (angle pt1 lpt2))
- (setq ang (- (angle pt1 pt2) ang))
- (if (< ang (- pi))
- (setq ang (+ (* 2 pi) ang))
- )
- (setq ptc (mapcar '(lambda(e1 e2) (/ (+ e1 e2) 2.0)) pt1 pt2))
- (command "_.arc" "c" ptc pt1 pt2)
- )
|