本帖最后由 qmqyqj 于 2021-1-12 17:51 编辑
- (defun c:dimt( / ss s0 ent0 ss-num)
- (setq dimtext (getstring "\n请输入替代文字:"))
- (prompt (strcat"请选取尺寸标注[替代文字:" dimtext "][回车设置]"))
- (setq ss (ssget '((0 . "DIMENSION"))))
- (if ss
- (progn
- (setq ss-num (sslength ss))
- (while (>= ss-num 1)
- (setq s0 (ssname ss 0))
- (setq ent0 (entget s0))
- (setq ent0 (subst (cons 1 dimtext)(assoc 1 ent0)ent0))
- (entmod ent0)
- (setq ss (ssdel s0 ss))
- (setq ss-num(sslength ss))
- );end of while
- );progn
- (progn
- (setq dimtext_saved dimtext)
- (setq dimtext(getstring (strcat "\n请输入替代文字[" dimtext "]:")))
- (if (= dimtext "")(setq dimtext dimtext_saved)(setq dimtext_saved dimtext))
- (c:dimt)
- )
- )
- )
|