本帖最后由 嘒彼小星 于 2023-7-10 17:14 编辑
- (defun C:tt ()
- (command "UNDO" "be")
- (if (setq E (cdr (assoc 1 (entget (car (entsel))))))
- (progn
- (setq ss (ssget (list '(0 . "TEXT")(cons 1 E))))
- (setq ss_gs (sslength ss))
- (setq i 0)
- (repeat ss_gs
- (setq ss_n (ssname ss i))
- (command "UCS" "e" ss_n)
- (setq ss_data (entget ss_n))
- (setq text_box (textbox ss_data))
- (setq text_box_1 (car text_box))
- (setq text_box_3 (cadr text_box))
- (command "RECTANG" text_box_1 text_box_3)
- (setq i (1+ i))
- )
- (command "UCS" "")
- (princ (strcat"\n共有" (itoa ss_gs) "个相同文字加框"))
- )
- )
- (command "UNDO" "e")
- (print)
- )
|