- (defun c:aa ()
- (setq i 0)
- (if (setq ss (ssget '((0 . "INSERT"))))
- (setq xx (ssget '((0 . "LINE"))))
- )
- (repeat (sslength ss)
- (setq xq (cdr (assoc 10 (entget (ssname ss i)))));获取块的坐标列表
- (setq zq1 (last xq)
- xyq1 (list (car xq) (cadr xq));列表用来比较判断
- q1xy xq);获取块的坐标表
- (setq j 0)
- (repeat (sslength xx)
- (setq hh1 (entget (ssname xx j)))
- (setq g1 (assoc 10 hh1))
- (setq s1 (cdr g1));获取直线的坐标列表
- (setq zs1 (last s1)
- xys1 (list (car s1) (cadr s1));列表用来比较判断
- s1xy (list xs1 ys1 zq1));直线起点新列表中已有块的高程,获取直线起点坐标列表
- (if (equal (distance xyq1 xys1) 0 1e-5)
- (setq hh1 (subst (cons 10 s1xy) g1 hh1))
- )
- (entmod hh1)
- (setq g2 (assoc 11 hh1))
- (setq s2 (cdr g2))
- (setq zs2 (last s2)
- xys2 (list (car s2) (cadr s2));列表用来比较判断
- s2xy (list xs2 ys2 zq1));直线端点新列表中已有块的高程,获取直线端点坐标列表
- (if (equal (distance xyq1 xys2) 0 1e-5)
- (setq hh1 (subst (cons 11 s2xy) g2 hh1))
- )
- (entmod hh1)
- (setq j (1+ j))
- )
- (setq i (1+ i))
- );repeat
- (princ)
- )
|