Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Does Drawing contain an Image

4 REPLIES 4
Reply
Message 1 of 5
petervose
140 Views, 4 Replies

Does Drawing contain an Image

I'm trying to return a list of loaded images on a drawing, but failing. If someone could point me in the right direction it would be greatly appreciated.
Thanks Peter
4 REPLIES 4
Message 2 of 5
rewilson
in reply to: petervose

(defun getImagePaths (/ data paths)
(if (setq data (dictsearch (namedobjdict) "acad_image_dict"))
(foreach item data
(if (= 350 (car item))
(setq
paths (cons (cdr (assoc 1 (entget (cdr item)))) paths)
)
)
)
)
paths
)


(defun c:dwgOk (/ data item)
(if (setq data (getImagePaths))
(if
(and
(= 1 (length data))
(setq item (car data))
(equal
(strcase
(strcat
(vl-filename-directory item)
"\\"
(vl-filename-base item)
)
)


(strcase
(strcat
(getvar "dwgprefix")
(vl-filename-base (getvar "dwgname"))
)
)
)
)
(princ
"\nFILENAME AND IMAGENAME MATCH"
)
(princ
(alert
"\nMORE THAN ONE IMAGE IS ATTACHED OR\nTHE FILENAMES/PATHS ARE NOT THE SAME"
)
)
)
(princ "\nno images attached")
)
(princ)



)
Message 3 of 5
petervose
in reply to: petervose

That's exactly what I was after - Thanks very much for the quick response and the code.
Peter
Message 4 of 5
rewilson
in reply to: petervose

You're welcome.........and thanks to Jason Piercey for helping out with the code. 🙂
Message 5 of 5
Anonymous
in reply to: petervose

Peter, If the name of the image is of any interest, take a look at the thread "Image detach using lisp" 2/18/2004. My last post there. Joe Burke "petervose" wrote in message news:21291556.1077646533693.JavaMail.jive@jiveforum1.autodesk.com... > I'm trying to return a list of loaded images on a drawing, but failing. If someone could point me in the right direction it would be greatly appreciated. > Thanks Peter

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost