本帖最后由 dunkel 于 2015-8-13 08:53 编辑
没接触过 zdm,不了解具体缘由。我的 acad 上是没有其它方插件的,只有个天正的查看插件,不会被自动加载,主动加载后也不见影响。下面的代码,筛选条件是依照上面的图形来的,你随便改吧。- (defun C:gjhz ( / xsel xl xi xc xtxt xt2)
- (vl-load-com)
- (setq xsel (ssget "X" (List (cons 0 "TEXT") (cons 7 "钢筋") (cons 8 "钢筋标注"))))
- (if xsel
- (progn
- (setq xc (sslength xsel) xi 0)
- (princ "\n")
- (while (< xi xc)
- (setq xl (entget (ssname xsel xi)) xtxt (cdr (assoc 1 xl)) xt2 (vl-string-subst "%%132" "\\U+0084" xtxt) xi (1+ xi))
- (if (/= xt2 xtxt)
- (progn
- (setq xln (subst (cons 1 xt2) (assoc 1 xl) xl))
- (entmod xln)
- )
- )
- (princ (strcat "\r" (itoa xi) ":" (itoa xc)))
- ) ; end of while(for each one in selection)
- (princ " Finished.")
- )
- ) ; end of if(has selects)
- (princ)
- ) ; end of (C:gjhz)
- (C:gjhz)
|