*耸耸肩*编码很有趣
- (defun c:LinePoints ( / i j ss e1 e2 p1 p2 p3 points )
- (if (setq i -1 ss (ssget '((0 . "LINE"))))
- (progn
- (while (setq e1 (ssname ss (setq i (1+ i) j i)))
- (setq points
- (cons (setq p1 (cdr (assoc 10 (entget e1))))
- (cons (setq p2 (cdr (assoc 11 (entget e1)))) points)
- )
- )
- (while (setq e2 (ssname ss (setq j (1+ j))))
- (if (setq p3 (inters p1 p2 (cdr (assoc 10 (entget e2))) (cdr (assoc 11 (entget e2)))))
- (setq points (cons p3 points))
- )
- )
- )
- (while points (entmakex (list (cons 0 "POINT") (cons 10 (car points))))
- (setq points
- (vl-remove-if '(lambda ( x ) (equal (car points) x 1e-) (cdr points))
- )
- )
- )
- )
- (princ)
- )
|