- (defun c:dimdd (/ measure plus real result ss text)
- (vl-load-com)
- (vla-endundomark
- (vla-get-activedocument
- (vlax-get-acad-object)
- )
- )
- (vla-startundomark
- (vla-get-activedocument
- (vlax-get-acad-object)
- )
- )
- (princ "\n★批量增减标注尺寸值 by carrot1983 [12/4/09]")
- (setq plus (getreal "\n输入增值<100.>: "))
- (if (and (cond ((null plus) (setq plus 100.))
- ((eq plus 0) nil)
- (t)
- )
- (setq ss (ssget '((0 . "DIMENSION"))))
- )
- (foreach obj
- (mapcar
- 'vlax-ename->vla-object
- (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
- )
- (if (and (setq text (vla-get-textoverride obj))
- (setq measure (vla-get-measurement obj))
- (/= text "")
- (numberp (read text))
- )
- (setq real (read text))
- (setq real measure)
- )
- (and real
- (setq result (vl-princ-to-string (+ real plus)))
- (vla-put-textoverride obj result)
- )
- )
- )
- (vla-endundomark
- (vla-get-activedocument
- (vlax-get-acad-object)
- )
- )
- (princ)
- )
- (princ "\n本程序作者: carrot1983 转贴请注明出处、作者.")
- (princ "\n本程序作命令: dimdd")
|