- 积分
- 36102
- 明经币
- 个
- 注册时间
- 2013-8-16
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2022-5-28 20:56:26
|
显示全部楼层
;Set global width for all polylines in the drawing,
;including blocks and nested blocks
;Stefan M.
;v1.01 - 25.07.2018
(defun C:gw ( / *error* acdoc)
(vl-load-com)
(setq acdoc (vla-get-activedocument (vlax-get-acad-object)))
(if (= (logand 8 (getvar 'undoctl)) 8) (vla-endundomark acdoc))
(vla-startundomark acdoc)
(defun *error* (msg)
(and msg
(not (wcmatch (strcase msg) "*EXIT*,*QUIT*,*CANCEL*,*BREAK*"))
(princ (strcat "\nError: " msg))
)
(if (= (logand 8 (getvar 'undoctl)) 8) (vla-endundomark acdoc))
(princ)
)
(if
(setq *wd*
(cond
((progn
(initget 4)
(getdist (strcat "\nSpecify Global Width <" (if *wd* (rtos *wd*) "") ">: "))
)
)
(*wd*)
)
)
(vlax-for bl (vla-get-blocks acdoc)
(if
(eq (vla-get-isxref bl) :vlax-false)
(vlax-for obj bl
(if
(eq (vla-get-objectname obj) "AcDbPolyline")
(vl-catch-all-apply 'vla-put-constantwidth (list obj *wd*))
)
)
)
)
)
(vla-regen acdoc acactiveviewport)
(*error* nil)
(princ)
) |
|