[500w008]500w008 04:20:22
(defun c:cc ( / sss si i pt1 pt2 pt_10 pt_11 ptlt pt_in )
(setvar "osmode" 0)
(setvar "cmdecho" 0)
(graphscr)
(setq pt1 (getpoint "\n 请输入点pt1:"))
(setq pt2 (getpoint "\n 请输入点pt2:"))
(setq sss (ssget "f" '((0 . "line") (8 . "*doet*,*axis*"))))
(setq si 0 i 0 ptlt'())
(repeat (sslength sss)
(progn
(setq pt_10 (cdr (assoc 10 (entget(ssname sss si)))))
(setq pt_11 (cdr (assoc 11 (entget(ssname sss si)))))
(setq pt_in (inter pt1 pt2 pt_10 pt_11))
(setq ptlt (cons pt_in ptlt))
)
(setq si (1+ si))
)
(while (setq pt_n (ssname ptlt i))
(setq g_lst (cons (cdr (assoc 10 (entget pt_n))) g_lst) i (1+ i))
)
(setq nlt (vl-sort lst '(lambda (e1 e2) (< (car e1) (car e2)))))
(princ)
)
(defun wr_l ()
(if (=> dis_1 dis_n) (setq 0.25d (/ dis_1 4)) (setq 0.25d (/ dis_n 4)))
(setq ang_g (angle pt1 pt2))
(setq pt_z (polar pt_in ang_g 0.25d)
pt_y (polar pt_in ang_g (* -1 0.25d))
pt_gz (polar pt_z (+ ang_g 45) 75)
pt_gy (polar pt_y (+ ang_g 135) 75)
)
(command "pline" pt_gz pt_z pt_y pt_gy "")
(princ)
) |