谢谢wyj_007 朋友帮找bug。重贴一次程序 - ;; dmvl = 块定义修改法-固定标注文字! v1.1-----by无痕.2004.3
- ;; 支持所有标注类型.
- ;;(getdimtext dimentity) = 取出标注的文本!
- (defun c:dmvl (/ ss n dm dml)
- (princ "\n选择要固定文字的标注:")
- (setq ss (ssget '((0 . "DIMENSION"))))
- (repeat (setq n (sslength ss))
- (setq dm (ssname ss (setq n (1- n)))
- dml(entget dm)
- dml(subst (cons 1 (getdimtext dm))(assoc 1 dml) dml))
- (entmod dml)
- )(princ (strcat "\n共处理" (itoa (sslength ss)) "个标注:"))
- (princ)
- )
- ;;取标注文本.
- (defun getdimtext (dm / e el)
- (setq e (cdr (assoc -2 (tblsearch "block" (cdr (assoc 2 (entget dm)))))))
- (while (and (setq e (entnext e))
- (not (member '(100 . "AcDbMText") (setq el (entget e)))))
- )
- (if e (cdr (assoc 1 el)) " ")
- )
|