马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 marting 于 2017-12-22 11:53 编辑
填充异常,就是填充面积为0的。图中有填充面积为0的,不好发现,统计工程量时候就出问题了。
下面代码,不需要打开DWG,批量搜索指定目录的DWG文件,找到后,文本屏幕打印出来文件名。
需要加载 晓东通用LISP函数库。或到开源函数库论坛找需要函数的代码。
xd::vla:catchapply
xd::vla:odbx
![](source/plugin/imc_colorcode/images/loading.gif) - (defun c:tt ()
- (defun _find (doc)
- (textpage)
- (setq dwglst nil)
- (princ (strcat "\n搜索 " (setq dwg (vla-get-name doc))))
- (setq layouts (vla-get-layouts doc))
- (setq dwglst nil)
- (vlax-for lay layouts
- (setq blk (vla-get-block lay))
- (setq tf t
- i -1
- )
- (while
- (and tf
- (setq
- o (xd::vla:catchapply vla-item (list blk (setq i (1+ i))))
- )
- )
- (if (and (= (vla-get-objectname o) "AcDbHatch")
- (not (xd::vla:catchapply vla-get-area (list o)))
- )
- (progn (setq tf nil)
- (setq dwglst (cons (vla-get-name doc) dwglst))
- )
- )
- )
- )
- (if dwglst
- (progn (princ "\n\n**********************\n发现异常填充,请核查.\n")
- (mapcar '(lambda (x) (princ "\n") (princ x)) dwglst)
- )
- )
- )
- (xd::vla:odbx '_find nil nil)
- (princ)
- )
|