<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get Image List Through VBA in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/get-image-list-through-vba/m-p/2307371#M18800</link>
    <description>Thanks Gary,&lt;BR /&gt;
&lt;BR /&gt;
"Gary McMaster" &lt;GLM at="" consiliumus="" period="" com=""&gt; wrote in message &lt;BR /&gt;
news:5990492@discussion.autodesk.com...&lt;BR /&gt;
&amp;gt;&amp;gt;(z_Get-Drawing-Images) will return a constructed list with names and&lt;BR /&gt;
paths.&lt;BR /&gt;
&lt;BR /&gt;
I don't fully understand your lisp but the sample below will return paths&lt;BR /&gt;
and/or filenames of images if that's all you're after. It won't tell you if&lt;BR /&gt;
the image is actually attached but you could determine that with a filtered&lt;BR /&gt;
selection set.&lt;BR /&gt;
&lt;BR /&gt;
I hope it helps.&lt;BR /&gt;
&lt;BR /&gt;
Gary&lt;BR /&gt;
&lt;BR /&gt;
Dim sImageFiles As String&lt;BR /&gt;
Dim oFile As AcadFileDependency&lt;BR /&gt;
&lt;BR /&gt;
For Each oFile In ThisDrawing.FileDependencies&lt;BR /&gt;
    If LCase(oFile.Feature) = "acad:image" Then&lt;BR /&gt;
        sImageFiles = sImageFiles &amp;amp; oFile.FullFileName &amp;amp; vbCrLf&lt;BR /&gt;
        'sImageFiles = sImageFiles &amp;amp; oFile.FileName &amp;amp; vbCrLf&lt;BR /&gt;
    End If&lt;BR /&gt;
Next&lt;BR /&gt;
&lt;BR /&gt;
MsgBox sImageFiles&lt;/GLM&gt;</description>
    <pubDate>Mon, 04 Aug 2008 16:05:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-08-04T16:05:03Z</dc:date>
    <item>
      <title>Get Image List Through VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/get-image-list-through-vba/m-p/2307369#M18798</link>
      <description>Here is my Lisp routine to get image list from a drawing:&lt;BR /&gt;
&lt;BR /&gt;
(defun z_Get-VLA-Objects ()&lt;BR /&gt;
     (and (or *CAD* (setq *CAD* (vlax-get-Acad-Object)))&lt;BR /&gt;
          (or *DOC* (setq *DOC* (vla-get-ActiveDocument *CAD*)))&lt;BR /&gt;
          (or *DIC* (setq *DIC* (vla-get-Dictionaries *DOC*))) )&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
(defun z_Get-Drawing-Images ( / dbe enm ent enl ret)&lt;BR /&gt;
 (if (and (z_Get-VLA-Objects)&lt;BR /&gt;
          (setq dbe (vla-Item *DIC* "ACAD_IMAGE_DICT"))&lt;BR /&gt;
          (setq enm (vlax-vla-Object-&amp;gt;EName dbe))&lt;BR /&gt;
          (setq ent (entget enm))&lt;BR /&gt;
          (while (assoc 3 ent)&lt;BR /&gt;
              (and (setq enm (cdr (assoc 350 (member (assoc 3 ent) ent))))&lt;BR /&gt;
                   (setq enl (entget enm))&lt;BR /&gt;
                   (setq ret (append ret (list (cons (cdr (assoc 3 ent))&lt;BR /&gt;
                                                     (cdr (assoc 1 &lt;BR /&gt;
enl)))))))&lt;BR /&gt;
              (setq ent (cdr (member (assoc 3 ent) ent)))&lt;BR /&gt;
              (&amp;lt; 0 (length ret))))&lt;BR /&gt;
      ret)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
(z_Get-Drawing-Images) will return a constructed list with names and paths.&lt;BR /&gt;
&lt;BR /&gt;
HOWEVER...&lt;BR /&gt;
Trying to do get the same info through VBA, seams to me, is nopt that easy:&lt;BR /&gt;
Here is the code (similar to above methods...)&lt;BR /&gt;
Where I'm doing wrong?&lt;BR /&gt;
IsEmpty(vTypeValue) is always returns true. Where is this data hidden in &lt;BR /&gt;
ACAD_IMAGE_DICT dictionary?&lt;BR /&gt;
Please help&lt;BR /&gt;
&lt;BR /&gt;
Private Sub z_GetImageRecords()&lt;BR /&gt;
&lt;BR /&gt;
    Dim oDict As AcadDictionary&lt;BR /&gt;
    Dim oItem As Object&lt;BR /&gt;
    Dim vDataType As Variant&lt;BR /&gt;
    Dim vTypeValue As Variant&lt;BR /&gt;
&lt;BR /&gt;
    Set oDict = ThisDrawing.Database.Dictionaries.Item("ACAD_IMAGE_DICT")&lt;BR /&gt;
    For Each oItem In oDict&lt;BR /&gt;
        oDict.GetXData "", vDataType, vTypeValue&lt;BR /&gt;
        If Not IsEmpty(vTypeValue) Then&lt;BR /&gt;
            For iCount = LBound(vTypeValue) To UBound(vTypeValue)&lt;BR /&gt;
                Debug.Print vTypeValue(iCount)&lt;BR /&gt;
            Next iCount&lt;BR /&gt;
        End If&lt;BR /&gt;
    Next oItem&lt;BR /&gt;
&lt;BR /&gt;
    Set oDict = Nothing&lt;BR /&gt;
    Set oItem = Nothing&lt;BR /&gt;
&lt;BR /&gt;
End Sub</description>
      <pubDate>Thu, 24 Jul 2008 20:25:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/get-image-list-through-vba/m-p/2307369#M18798</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-24T20:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Get Image List Through VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/get-image-list-through-vba/m-p/2307370#M18799</link>
      <description>&amp;gt;&amp;gt;(z_Get-Drawing-Images) will return a constructed list with names and&lt;BR /&gt;
paths.&lt;BR /&gt;
&lt;BR /&gt;
I don't fully understand your lisp but the sample below will return paths&lt;BR /&gt;
and/or filenames of images if that's all you're after. It won't tell you if&lt;BR /&gt;
the image is actually attached but you could determine that with a filtered&lt;BR /&gt;
selection set.&lt;BR /&gt;
&lt;BR /&gt;
I hope it helps.&lt;BR /&gt;
&lt;BR /&gt;
Gary&lt;BR /&gt;
&lt;BR /&gt;
Dim sImageFiles As String&lt;BR /&gt;
Dim oFile As AcadFileDependency&lt;BR /&gt;
&lt;BR /&gt;
For Each oFile In ThisDrawing.FileDependencies&lt;BR /&gt;
    If LCase(oFile.Feature) = "acad:image" Then&lt;BR /&gt;
        sImageFiles = sImageFiles &amp;amp; oFile.FullFileName &amp;amp; vbCrLf&lt;BR /&gt;
        'sImageFiles = sImageFiles &amp;amp; oFile.FileName &amp;amp; vbCrLf&lt;BR /&gt;
    End If&lt;BR /&gt;
Next&lt;BR /&gt;
&lt;BR /&gt;
MsgBox sImageFiles</description>
      <pubDate>Fri, 25 Jul 2008 11:52:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/get-image-list-through-vba/m-p/2307370#M18799</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-25T11:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Get Image List Through VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/get-image-list-through-vba/m-p/2307371#M18800</link>
      <description>Thanks Gary,&lt;BR /&gt;
&lt;BR /&gt;
"Gary McMaster" &lt;GLM at="" consiliumus="" period="" com=""&gt; wrote in message &lt;BR /&gt;
news:5990492@discussion.autodesk.com...&lt;BR /&gt;
&amp;gt;&amp;gt;(z_Get-Drawing-Images) will return a constructed list with names and&lt;BR /&gt;
paths.&lt;BR /&gt;
&lt;BR /&gt;
I don't fully understand your lisp but the sample below will return paths&lt;BR /&gt;
and/or filenames of images if that's all you're after. It won't tell you if&lt;BR /&gt;
the image is actually attached but you could determine that with a filtered&lt;BR /&gt;
selection set.&lt;BR /&gt;
&lt;BR /&gt;
I hope it helps.&lt;BR /&gt;
&lt;BR /&gt;
Gary&lt;BR /&gt;
&lt;BR /&gt;
Dim sImageFiles As String&lt;BR /&gt;
Dim oFile As AcadFileDependency&lt;BR /&gt;
&lt;BR /&gt;
For Each oFile In ThisDrawing.FileDependencies&lt;BR /&gt;
    If LCase(oFile.Feature) = "acad:image" Then&lt;BR /&gt;
        sImageFiles = sImageFiles &amp;amp; oFile.FullFileName &amp;amp; vbCrLf&lt;BR /&gt;
        'sImageFiles = sImageFiles &amp;amp; oFile.FileName &amp;amp; vbCrLf&lt;BR /&gt;
    End If&lt;BR /&gt;
Next&lt;BR /&gt;
&lt;BR /&gt;
MsgBox sImageFiles&lt;/GLM&gt;</description>
      <pubDate>Mon, 04 Aug 2008 16:05:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/get-image-list-through-vba/m-p/2307371#M18800</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-08-04T16:05:03Z</dc:date>
    </item>
  </channel>
</rss>

