Costinbos77 Posted November 7, 2012 Posted November 7, 2012 How can I check if a picture name is found in drawing. Because if you try to insert another image with the same name, is looking for first. Costin Quote
MSasu Posted November 7, 2012 Posted November 7, 2012 This will list the paths from where all the images loaded in drawing are - doesn't account for duplicates: (if (setq ssetImages (ssget "_X" '((0 . "IMAGE")))) (while (> (sslength ssetImages) 0) (print (strcat "\n" (cdr (assoc 1 (entget (cdr (assoc 340 (entget (setq imageItem (ssname ssetImages 0)))))))))) (setq ssetImages (ssdel imageItem ssetImages)) ) ) Quote
Costinbos77 Posted November 7, 2012 Author Posted November 7, 2012 Thanks for the idea, I'll try. I did a routine for calculating nomenclature plans in stereographic projection 1970 and 1930 and if the image was already inserted but it was found not insert path stored image. Costin Quote
Lee Mac Posted November 7, 2012 Posted November 7, 2012 Here is another way, through Visual LISP: (defun _ListImages ( doc ) (vlax-for f (vla-get-filedependencies doc) (if (= "acad:image" (strcase (vla-get-feature f) t)) (print (vla-get-fullfilename f)) ) ) (princ) ) (_ListImages (vla-get-activedocument (vlax-get-acad-object))) Quote
Costinbos77 Posted November 9, 2012 Author Posted November 9, 2012 (edited) We tested two suggestions. Dxf codes classic version works fine. ActiveX version does not work. I have attached an example. Tiff file to be stored in some other way than the dwg file to see the problem. Try to insert a TIFF file. This is the problem I want to solve. Tiff Exemple.dwg Edited December 2, 2012 by Costinbos77 Quote
Lee Mac Posted November 9, 2012 Posted November 9, 2012 The image in your example drawing is not found, hence it is not listed in the File Dependencies Collection. My ActiveX code & MSasu's code are not equivalent; my code is iterating over the File Dependencies Collection, whereas MSasu's code is checking for IMAGE entities in the drawing database. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.