马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
 - (defun c:XDTB_BatDelImg ( / doc dwg fns gap imageItem num num1 odbx_dict)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (defun _remove (doc)
- (defun _print-progess (doc gap / dwg)
- (setq dwg (vla-get-name doc)
- dwg (strcat (vl-filename-base dwg) (vl-filename-extension dwg))
- )
- (princ (xd::string:tailfill (strcat "\n搜索 " dwg) " " gap))
- )
- (setq num1 0)
- (_print-progess doc 50)
- (setq odbx_dict (vla-get-dictionaries doc))
- (vl-Catch-All-Apply
- '(lambda ()
- (vlax-for imageItem (vla-item odbx_dict "ACAD_IMAGE_DICT")
- (vla-delete imageItem)
- (setq num1 (1+ num1))
- )
- )
- )
- (setq fns (+ fns num1)
- num (1+ num)
- )
- (princ (strcat " 删除了 " (itoa num1) " 图像定义."))
- )
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (defun _check ()
- (if (or (not xd::vla:odbx) (not (= (type xd::vla:odbx) 'SUBR)))
- (progn (princ "\n请加载晓东通用LI-SP函数库再执行.") (exit))
- t
- )
- )
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (defun _main ()
- (setq num 0
- fns 0
- )
- (xd::vla:odbx '_remove nil t)
- (princ (strcat "\n\n共处理了 "
- (itoa num)
- " 个DWG文件,共删除图像定义 "
- (itoa fns)
- "个."
- )
- )
- (princ)
- )
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;main
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (_main)
- (princ)
- )
|