可以
现在试试这个草稿,告诉我它是否适合你的需要。
- (defun c:Test (/ b ss)
- (if (and (/= (setq b (getstring t "\n Enter name of Block :")) "")
- (if (not (tblsearch "BLOCK" B))
- (progn
- (princ "\n name of Block is not existed ")
- nil
- )
- t
- )
- (progn (prompt " Select texts ")
- (setq
- ss (ssget "_:L" '((0 . "*TEXT") (1 . "j") (7 . "FOP11901")))
- ))
- )
- ((lambda (i / sn e)
- (while (setq sn (ssname ss (setq i (1+ i))))
- (if (entmakex (list '(0 . "INSERT")
- (cons 2 b)
- (assoc 10 (entget sn))
- (assoc 50 (entget sn))
- '(41 . 1.)
- '(42 . 1.)
- '(43 . 1.)
- )
- )
- (entdel sn)
- )
- )
- )
- -1
- )
- )
- (princ)
- )
|