马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
 - (defun RemoveAllRaster (doc / _catchapply dict lockd)
- (vl-load-com)
- (defun _catchapply (method params / result)
- (if (not (vl-catch-all-error-p
- (setq result (vl-catch-all-apply method params))
- )
- )
- result
- )
- )
- (vlax-for layer (vla-get-layers doc)
- (if (eq :vlax-true (vla-get-lock layer))
- (vla-put-lock
- (car (setq lockd (cons layer lockd)))
- :vlax-false
- )
- )
- )
- (vlax-for block (vla-get-blocks doc)
- (vlax-for object block
- (if (member (vla-get-objectname object)
- '("AcDbOle2Frame" "AcDbRasterImage")
- )
- (_catchapply 'vla-delete (list object))
- )
- )
- )
- (if (setq dict (_catchapply
- 'vla-item
- (list (vla-get-dictionaries doc) "ACAD_IMAGE_DICT")
- )
- )
- (progn (vlax-for object dict
- (_catchapply 'vla-delete (list object))
- )
- (_catchapply 'vla-delete (list dict))
- )
- )
- (if (setq dict (_catchapply
- 'vla-item
- (list (vla-get-dictionaries doc) "ACAD_IMAGE_VARS")
- )
- )
- (_catchapply 'vla-delete (list dict))
- )
- (foreach layer lockd (vla-put-lock layer :vlax-true))
- (vla-regen doc acallviewports)
- (princ)
- )
- (defun c:RemoveAllPics nil
- (RemoveAllRaster
- (vla-get-activedocument (vlax-get-acad-object))
- )
- (princ)
- )
|