<?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: Need a LISP check to see if the drawing has a pdf underlay in it in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-a-lisp-check-to-see-if-the-drawing-has-a-pdf-underlay-in-it/m-p/13404536#M2153</link>
    <description>&lt;P&gt;Anyone?&lt;/P&gt;</description>
    <pubDate>Wed, 02 Apr 2025 14:20:20 GMT</pubDate>
    <dc:creator>fk</dc:creator>
    <dc:date>2025-04-02T14:20:20Z</dc:date>
    <item>
      <title>Need a LISP check to see if the drawing has a pdf underlay in it</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-a-lisp-check-to-see-if-the-drawing-has-a-pdf-underlay-in-it/m-p/13364576#M2150</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;can anyone help me with some LISP code that can check if the active drawing contains DWF, PDF, DGN, OLE underlays?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;\Freddy&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 14:33:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-a-lisp-check-to-see-if-the-drawing-has-a-pdf-underlay-in-it/m-p/13364576#M2150</guid>
      <dc:creator>fk</dc:creator>
      <dc:date>2025-03-11T14:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need a LISP check to see if the drawing has a pdf underlay in it</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-a-lisp-check-to-see-if-the-drawing-has-a-pdf-underlay-in-it/m-p/13364803#M2151</link>
      <description>&lt;P&gt;Variable 'r' will hold a list of those items if found:&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(defun c:foo (/ r)
  (vlax-for b (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
    (vlax-for o	b
      (and (wcmatch (strcase (vla-get-objectname o)) "*PDF*,*DWF*,*DGN*,*OLE*FRAME*")
	   (setq r (cons o r))
      )
    )
  )
  r
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 11 Mar 2025 16:05:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-a-lisp-check-to-see-if-the-drawing-has-a-pdf-underlay-in-it/m-p/13364803#M2151</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2025-03-11T16:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need a LISP check to see if the drawing has a pdf underlay in it</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-a-lisp-check-to-see-if-the-drawing-has-a-pdf-underlay-in-it/m-p/13366343#M2152</link>
      <description>&lt;P&gt;Many thanks. Easy when you know how.&lt;/P&gt;&lt;P&gt;That code works fine, as long as AutoCAD finds the "underlay" and as long as it is inserted into the drawing. It doesn't work as well if the "underlay" is "Not found" or "Unreferenced". How easy is it to also take into account such cases?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 09:13:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-a-lisp-check-to-see-if-the-drawing-has-a-pdf-underlay-in-it/m-p/13366343#M2152</guid>
      <dc:creator>fk</dc:creator>
      <dc:date>2025-03-12T09:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need a LISP check to see if the drawing has a pdf underlay in it</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-a-lisp-check-to-see-if-the-drawing-has-a-pdf-underlay-in-it/m-p/13404536#M2153</link>
      <description>&lt;P&gt;Anyone?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 14:20:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-a-lisp-check-to-see-if-the-drawing-has-a-pdf-underlay-in-it/m-p/13404536#M2153</guid>
      <dc:creator>fk</dc:creator>
      <dc:date>2025-04-02T14:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need a LISP check to see if the drawing has a pdf underlay in it</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-a-lisp-check-to-see-if-the-drawing-has-a-pdf-underlay-in-it/m-p/13404827#M2154</link>
      <description>&lt;P&gt;Check the entity type of objects in all those categories with:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;(cdr (assoc 0 (entget (car (entsel "\nSelect an underlay object: ")))))&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;and if in all cases the types end with "UNDERLAY" with different prefixes, then this will find them:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;(ssget "_X" '((0 . "*UNDERLAY")))&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;which I suspect [without testing] would ignore any that are unreferenced.&lt;/P&gt;
&lt;P&gt;If you just want to know &lt;EM&gt;whether or not&lt;/EM&gt; there are any, you could do something like this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;(prompt&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; (strcat&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; "\nThere are "&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; (if&amp;nbsp;(ssget "_X" '((0 . "*UNDERLAY"))) "" "no ")&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; "Underlay object(s) in this drawing."&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp; )&lt;/STRONG&gt;&lt;FONT color="#999999"&gt;; strcat&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;FONT color="#999999"&gt;; prompt&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;If you want to &lt;EM&gt;see them selected/gripped/highlighted&lt;/EM&gt;, this will do that with all that are in the current space:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;(sssetfirst nil (ssget "_X" '((0 . "*UNDERLAY"))))&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Or they could be saved into a selection set to process however you like.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 16:50:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-a-lisp-check-to-see-if-the-drawing-has-a-pdf-underlay-in-it/m-p/13404827#M2154</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2025-04-02T16:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need a LISP check to see if the drawing has a pdf underlay in it</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-a-lisp-check-to-see-if-the-drawing-has-a-pdf-underlay-in-it/m-p/13405024#M2155</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/272647"&gt;@fk&lt;/a&gt;&amp;nbsp;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From R200 to R2017 there was file dependencies object but it turn&amp;nbsp;&lt;SPAN&gt;obsolete from R2018&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;so underlay objects move to dictionaries&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;check dumpUnderlayDef command to retrieve underlay objects. i test it only on pdf, dwf files think OLE objects does not consider underlay&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i do not have dgn to insert so i &lt;SPAN&gt;gamble on dictionary table name is similar to&amp;nbsp;"ACAD_PDFDEFINITIONS", "ACAD_DWFDEFINITIONS" as&amp;nbsp;"ACAD_DGNDEFINITIONS".&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;works even objects detached or erased&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;enjoy&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Moshe&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;; dump underlay definitions

(defun c:dumpUnderlayDef (/ adoc dict table AcDbDictionary AcDbObj i ename elist)
 (setq adoc (vla-get-activedocument (vlax-get-acad-object)))
 (setq dict (vla-get-dictionaries adoc))
  
 (foreach table '("ACAD_PDFDEFINITIONS" "ACAD_DWFDEFINITIONS" "ACAD_DGNDEFINITIONS")
  (if (and
	 (not
	     (vl-catch-all-error-p
	       (setq AcDbDictionary (vl-catch-all-apply 'vla-item (list dict table)))
	     )
         )
         (&amp;gt; (vla-get-count AcDbDictionary) 0)
      )
   (progn
    (terpri)
    (princ table)
    (setq i 0)
    (while (&amp;lt; i (vla-get-count AcDbDictionary))
     (setq AcDbObj (vla-item AcDbDictionary i))
     (setq ename (vlax-vla-object-&amp;gt;ename AcDbObj))
     (setq elist (entget ename))
     (terpri)
     (princ (cdr (assoc '1 elist)))
     (setq i (1+ i))
     (vlax-release-object AcDbObj)
    ); while
    
    (vlax-release-object AcDbDictionary)
   ); progn
  ); if

 ); foreach

 (vlax-release-object dict)
 (vlax-release-object adoc)

 (princ)
); c:dumpUnderlayDef&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 18:12:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-a-lisp-check-to-see-if-the-drawing-has-a-pdf-underlay-in-it/m-p/13405024#M2155</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2025-04-02T18:12:37Z</dc:date>
    </item>
  </channel>
</rss>

