Jump to content

Recommended Posts

Posted

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

Posted

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))
)
)

Posted

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

Posted

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)))

Posted (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

17n2.jpg

Edited by Costinbos77
Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...