- 积分
- 2188
- 明经币
- 个
- 注册时间
- 2010-5-24
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
现使用软件Mechnical cad 2007
在实际的设计过程中经常会遇到类似情况
一些图画好了,包括标注,粗糙度,焊接符号都完成之后
又要对该图的比例作调整,
标注是没什么问题,修改一下标注样式就可以了
可其它的一些内容,如粗糙度,焊接符号,还有说明文字就不太好办了
要一个一个的挪开,待图的比例调整好之后再逐一挪回来
这样做相当麻烦
广大设计者们的效率将会迈上一个台阶
下面有段快速修改尺寸标注和文字修改,期待高手能否把粗糙度和焊接符号添进去!!!!!!!!!!!
(defun ax:getboundingbox (entname / entpl entpr ptlist)
(vla-getboundingbox (vlax-ename->vla-object entname) 'entpl 'entpr)
(setq ptlist (mapcar 'vlax-safearray->list (list entpl entpr)))
(mapcar '(lambda (x) (trans x 0 1)) ptlist)
);end defun
(defun getentdxf (ent dxf)
(cond
((= (type ent) 'ename)
(cdr (assoc dxf (entget ent '( "*" ))))
);end "("
((= (type ent) 'vla-object)
(cdr (assoc dxf (entget (vlax-vla-object->ename ent) '( "*" ))))
);end "("
);end cond
);end defun
(setq *en2obj* vlax-ename->vla-object)
(defun c:ds (/ entdata entgrp entname n ptlist scale)
(prompt "根据图框比例自动改变图框内所有标注全局比例" )
(if (setq entname (entsel "\n请选择图框" ))
(if (= "INSERT" (getentdxf (car entname) 0))
(progn
(command "zoom" "o" (car entname) "" )
(setq ptlist (ax:getboundingbox (car entname)))
(setq entgrp (ssget "W" (car ptlist) (cadr ptlist) '((0 . "DIMENSION,*TEXT,*LINE,HATCH" ))))
(setq scale (vla-get-XScaleFactor (*en2obj* (car entname))))
(repeat (setq n (sslength entgrp))
(setq entname (ssname entgrp (setq n (1- n))))
(cond
((= "DIMENSION" (getentdxf entname 0))
(vla-put-ScaleFactor (*en2obj* entname) scale)
);end "("
((wcmatch (getentdxf entname 0) "*TEXT" )
(vla-put-Height (*en2obj* entname) (* (getvar "textsize" ) scale))
);end "("
);end cond
);end repeat
);end progn
);end if
);end if
(princ)
);end defun
(princ)
);end defun
|
|