本帖最后由 llsheng_73 于 2023-8-21 15:50 编辑
- (defun c:tt(/ *doc);;;拆离所有外部DWG参照及未参照光栅图像
- (vl-load-com)
- ;;拆离外部DWG参照
- (vlax-for blk(vlax-get-property(setq *doc(vlax-get-property(vlax-get-acad-object)'ActiveDocument))'blocks)
- (or(equal(vlax-get-property blk'IsXRef):vlax-false)
- (vlax-invoke-method blk'unload)
- (vlax-invoke-method blk'Detach)))
- ;;拆离未参照光栅图像
- (vlax-for x(vlax-invoke-method(vlax-get-property *doc 'Dictionaries)'item "ACAD_IMAGE_DICT")
- (or(vl-position'(280 . 1)(entget(vlax-vla-object->ename x)))(vlax-invoke-method x'delete)))
- )
|