<?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: Lisp routine to load / unload all xrefs ignoring current ones unloaded? in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-routine-to-load-unload-all-xrefs-ignoring-current-ones/m-p/13772611#M26741</link>
    <description>&lt;P&gt;Here's one... I'll let you do the other, if you feel it's necessary (unloading all inherently only unloads those that are loaded):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(vl-load-com)

(defun c:XRR (/ rewind loadedXrefs)

  (setq rewind t)
  (while (setq blockData (tblnext "block" rewind))
    (setq rewind nil)
    (if (and (= 4 (logand 4 (cdr (assoc 70 blockData))))
             (= 32 (logand 32 (cdr (assoc 70 blockData))))
        )
      (setq loadedXrefs (cons (cdr (assoc 2 blockData)) loadedXrefs))
    )
  )

  (if loadedXrefs
    (command
      "-xref"
      "r"
      (vl-string-right-trim
        ","
        (apply
          'strcat
          (mapcar
            (function
              (lambda (x) (strcat x ","))
            )
            loadedXrefs
          )
        )
      )
    )
    (prompt "\n ** No loaded XREFs found ** \n")
  )

  (princ)
)&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 18 Aug 2025 17:43:53 GMT</pubDate>
    <dc:creator>BlackBox_</dc:creator>
    <dc:date>2025-08-18T17:43:53Z</dc:date>
    <item>
      <title>Lisp routine to load / unload all xrefs ignoring current ones unloaded?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-routine-to-load-unload-all-xrefs-ignoring-current-ones/m-p/13769422#M26736</link>
      <description>&lt;P&gt;I'm working with drawings that contain numerous Xrefs, and some of them are intentionally unloaded. I currently use a LISP routine that unloads/reloads all Xrefs, but it's time-consuming and challenging to keep track of which ones should remain unloaded after running the lisp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can the LISP routine be modified to load and unload all Xrefs while preserving the original unload status, so that it only reloads those that were previously loaded and leaves the intentionally unloaded ones untouched&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2025 20:02:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-routine-to-load-unload-all-xrefs-ignoring-current-ones/m-p/13769422#M26736</guid>
      <dc:creator>ME42L</dc:creator>
      <dc:date>2025-08-15T20:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp routine to load / unload all xrefs ignoring current ones unloaded?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-routine-to-load-unload-all-xrefs-ignoring-current-ones/m-p/13772611#M26741</link>
      <description>&lt;P&gt;Here's one... I'll let you do the other, if you feel it's necessary (unloading all inherently only unloads those that are loaded):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(vl-load-com)

(defun c:XRR (/ rewind loadedXrefs)

  (setq rewind t)
  (while (setq blockData (tblnext "block" rewind))
    (setq rewind nil)
    (if (and (= 4 (logand 4 (cdr (assoc 70 blockData))))
             (= 32 (logand 32 (cdr (assoc 70 blockData))))
        )
      (setq loadedXrefs (cons (cdr (assoc 2 blockData)) loadedXrefs))
    )
  )

  (if loadedXrefs
    (command
      "-xref"
      "r"
      (vl-string-right-trim
        ","
        (apply
          'strcat
          (mapcar
            (function
              (lambda (x) (strcat x ","))
            )
            loadedXrefs
          )
        )
      )
    )
    (prompt "\n ** No loaded XREFs found ** \n")
  )

  (princ)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 18 Aug 2025 17:43:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-routine-to-load-unload-all-xrefs-ignoring-current-ones/m-p/13772611#M26741</guid>
      <dc:creator>BlackBox_</dc:creator>
      <dc:date>2025-08-18T17:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp routine to load / unload all xrefs ignoring current ones unloaded?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-routine-to-load-unload-all-xrefs-ignoring-current-ones/m-p/13813468#M26875</link>
      <description>&lt;P&gt;Could you write the other? its been a while and it to work!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2025 23:48:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-routine-to-load-unload-all-xrefs-ignoring-current-ones/m-p/13813468#M26875</guid>
      <dc:creator>ME42L</dc:creator>
      <dc:date>2025-09-16T23:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp routine to load / unload all xrefs ignoring current ones unloaded?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-routine-to-load-unload-all-xrefs-ignoring-current-ones/m-p/13813565#M26876</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12456486"&gt;@ME42L&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Could you write the other? its been a while and it to work!&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Your original XRU.lsp is perfectly fine:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:XRU (/ )
  (command "._-xref" "_u" "*")
  (princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2025 02:03:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-routine-to-load-unload-all-xrefs-ignoring-current-ones/m-p/13813565#M26876</guid>
      <dc:creator>BlackBox_</dc:creator>
      <dc:date>2025-09-17T02:03:27Z</dc:date>
    </item>
  </channel>
</rss>

