- (defun c:TKLX ( / e1 p bname ss n)
- (setq e1 (entsel "\n选择指定块:"))
- (if (and e1 (= (cdr (assoc 0 (setq ent (entget (car e1))))) "INSERT"))
- (if (setq p (getpoint "\n指定一点:")) (progn
- (setq bname (assoc 2 ent))
- (princ "\n选择块<回车全选>: ")
- (or (setq ss (ssget (list '(0 . "INSERT") bname)))
- (setq ss (ssget "X" (list '(0 . "INSERT") bname)))
- )
- (repeat (setq n (sslength ss))
- (entmake
- (list
- '(0 . "LINE")
- (cons 10 p)
- (cons 11 (cdr(assoc 10 (entget (ssname ss (setq n (1- n)))))))
- )
- )
- )
- ))
- )
- ;(entmake (list '(0 . "TEXT") (cons 1 内容) (cons 10 坐标) (cons 40 字高)))
- (entmake (list '(0 . "TEXT") (cons 1 (itoa (sslength ss))) (cons 10 p) (cons 40 100)))
- (princ)
- )
|