Files
lisp-scr/imagePaths.lsp
2018-11-26 22:23:22 +01:00

29 lines
1.0 KiB
Common Lisp

(defun c:imagePaths (Doc / LayoutCol EndList)
; Returns a list of list of all the Xrefs and Images with their paths withina drawing.
(vl-load-com)
(if (not Doc)
(setq Doc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
)
(setq LayoutCol (vla-get-Layouts Doc))
(vlax-for i LayoutCol
(vlax-for Obj (vla-get-Block i)
(cond
((= (vla-get-ObjectName Obj) "AcDbRasterImage")
(if (not (assoc (vla-get-Name Obj) EndList))
(setq EndList (cons (cons (vla-get-Name Obj) (vla-get-ImageFile Obj))
EndList))
)
)
((and (= (vla-get-ObjectName Obj) "AcDbBlockReference")
(vlax-property-available-p Obj 'Path))
(if (not (assoc (vla-get-Name Obj) EndList))
(setq EndList (cons (cons (vla-get-Name Obj) (vla-get-Path Obj))
EndList))
)
)
)
)
)
EndList
)