对于dim styles,Lee Mac做了以下lisp。这对他们大多数人都有效。我能够合并大多数dim样式,但并非所有样式(例如ISO-25_2)都无法与ISO-25合并,我相信是这样的,因为它用于某些动态块中进行值导出。我来测试一下。
谢谢李。。。或Mac
- (defun c:MergeDims ( / d1 d2 ss ) (vl-load-com)
- ;; Example by Lee Mac 2010 - [url="http://www.lee-mac.com"]www.lee-mac.com[/url]
- (if
- (and
- (vl-every
- (function
- (lambda ( sym str )
- (while
- (not
- (or
- (eq ""
- (set sym
- (getstring t str)
- )
- )
- (tblsearch "DIMSTYLE" (eval sym))
- )
- )
- (princ "\n** DimStyle not Found **")
- )
- (not (eq "" (eval sym)))
- )
- )
- (list 'd1 'd2)
- (list "\nSpecify DimStyle to Merge <Exit> : " "\nSpecify DimStyle to Use <Exit> : ")
- )
- (ssget "_X" (list (cons 0 "*DIMENSION") (cons 3 d1)))
- )
- (progn
- (vlax-for dim
- (setq ss
- (vla-get-ActiveSelectionSet
- (vla-get-ActiveDocument (vlax-get-acad-object))
- )
- )
- (vla-put-StyleName dim d2)
- )
- (vla-delete ss)
- )
- )
- (princ)
- )
|