<?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: select xrefs but exclude a few using wildcards?? in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-xrefs-but-exclude-a-few-using-wildcards/m-p/8741017#M89656</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6400150"&gt;@DC-MWA&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is my version (untested)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;enjoy&lt;/P&gt;
&lt;P&gt;moshe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun xr_relpath (/ findxref verify_name ;| local functions |;)
  
 (defun findxref (/ td xrf)
  (while (setq td (tblnext "block" (not td)))
   (and (= (logand (cdr (assoc 70 td)) 4) 4)
        (setq xrf (cons (strcase (cdr (assoc 2 td))) xrf))
   )
  )

  xrf
 ); findxref


 (defun verify_name (/ exclude ; local function
		       bname)
   
  (defun exclude ()
   (vl-remove-if
    'not
     (mapcar
      '(lambda (bn)
         (if (and
               (wcmatch (strcase bn) "~*TB*")
               (wcmatch (strcase bn) "~*TITLEBLOCK*")
               (wcmatch (strcase bn) "~*STAMP")
             )
          bn
         )
       ); lambda
       (findxref) 
      ); mapcar
   ); vl-remove-if
  ); exclude

  (setq bname "") 
  (foreach bn (exclude)
   (setq bname (strcat bname bn ","))
  )

  ; remove last comma
  (substr bname 1 (1- (strlen bname)))
 ); verify_name

  
 (if (findxref)
  (progn
   (princ "\nMaking xref paths relative...")
   (setvar "cmdecho" 0)
   (command "-xref" "t" (verify_name) "r")
   (setvar "cmdecho" 1)
  );end pr
  (progn
   (Princ "\nNo xrefs found in drawing")
  );end pr
 );end if
  
 (princ)
)

&lt;/PRE&gt;</description>
    <pubDate>Thu, 18 Apr 2019 21:08:56 GMT</pubDate>
    <dc:creator>Moshe-A</dc:creator>
    <dc:date>2019-04-18T21:08:56Z</dc:date>
    <item>
      <title>select xrefs but exclude a few using wildcards??</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-xrefs-but-exclude-a-few-using-wildcards/m-p/8740906#M89655</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have a cool little routine we use within our acaddoc that sets all xrefs to relative paths.&lt;/P&gt;
&lt;P&gt;Several users are having trouble with the titleblocks which are linked to our server.&lt;/P&gt;
&lt;P&gt;I'm trying to remove xrefs named *tb*dwg and *titleblock*.dwg from the selection set.&lt;/P&gt;
&lt;P&gt;I have attached the lisp in question.&lt;/P&gt;
&lt;P&gt;Thanks in advance for any input.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 20:09:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-xrefs-but-exclude-a-few-using-wildcards/m-p/8740906#M89655</guid>
      <dc:creator>DC-MWA</dc:creator>
      <dc:date>2019-04-18T20:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: select xrefs but exclude a few using wildcards??</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-xrefs-but-exclude-a-few-using-wildcards/m-p/8741017#M89656</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6400150"&gt;@DC-MWA&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is my version (untested)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;enjoy&lt;/P&gt;
&lt;P&gt;moshe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun xr_relpath (/ findxref verify_name ;| local functions |;)
  
 (defun findxref (/ td xrf)
  (while (setq td (tblnext "block" (not td)))
   (and (= (logand (cdr (assoc 70 td)) 4) 4)
        (setq xrf (cons (strcase (cdr (assoc 2 td))) xrf))
   )
  )

  xrf
 ); findxref


 (defun verify_name (/ exclude ; local function
		       bname)
   
  (defun exclude ()
   (vl-remove-if
    'not
     (mapcar
      '(lambda (bn)
         (if (and
               (wcmatch (strcase bn) "~*TB*")
               (wcmatch (strcase bn) "~*TITLEBLOCK*")
               (wcmatch (strcase bn) "~*STAMP")
             )
          bn
         )
       ); lambda
       (findxref) 
      ); mapcar
   ); vl-remove-if
  ); exclude

  (setq bname "") 
  (foreach bn (exclude)
   (setq bname (strcat bname bn ","))
  )

  ; remove last comma
  (substr bname 1 (1- (strlen bname)))
 ); verify_name

  
 (if (findxref)
  (progn
   (princ "\nMaking xref paths relative...")
   (setvar "cmdecho" 0)
   (command "-xref" "t" (verify_name) "r")
   (setvar "cmdecho" 1)
  );end pr
  (progn
   (Princ "\nNo xrefs found in drawing")
  );end pr
 );end if
  
 (princ)
)

&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Apr 2019 21:08:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-xrefs-but-exclude-a-few-using-wildcards/m-p/8741017#M89656</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2019-04-18T21:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: select xrefs but exclude a few using wildcards??</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-xrefs-but-exclude-a-few-using-wildcards/m-p/8741043#M89657</link>
      <description>&lt;P&gt;or a little more shorter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun xr_relpath (/ findxref verify_name ;| local functions |;)
  
 (defun findxref (/ td xrf)
  (while (setq td (tblnext "block" (not td)))
   (and (= (logand (cdr (assoc 70 td)) 4) 4)
        (setq xrf (cons (strcase (cdr (assoc 2 td))) xrf))
   )
  )

  xrf
 ); findxref

 (defun verify_name ()
  (apply
   'strcat
   (vl-remove-if
    'not
     (mapcar
      '(lambda (bn)
        (if (and
               (wcmatch (strcase bn) "~*TB*")
               (wcmatch (strcase bn) "~*TITLEBLOCK*")
               (wcmatch (strcase bn) "~*STAMP")
            )
        (strcat bn ",")
       )
      ); lambda
     (findxref) 
    ); mapcar
   ); vl-remove-if
  ) 
 ); verify_name
  
 (if (findxref)
  (progn
   (princ "\nMaking xref paths relative...")
   (setvar "cmdecho" 0)
   (command "-xref" "t" (verify_name) "r")
   (setvar "cmdecho" 1)
  );end pr
  (progn
   (Princ "\nNo xrefs found in drawing")
  );end pr
 );end if
  
 (princ)
)
&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Apr 2019 21:22:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-xrefs-but-exclude-a-few-using-wildcards/m-p/8741043#M89657</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2019-04-18T21:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: select xrefs but exclude a few using wildcards??</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-xrefs-but-exclude-a-few-using-wildcards/m-p/8741048#M89658</link>
      <description>&lt;P&gt;that works great!&lt;/P&gt;
&lt;P&gt;thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 21:28:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-xrefs-but-exclude-a-few-using-wildcards/m-p/8741048#M89658</guid>
      <dc:creator>DC-MWA</dc:creator>
      <dc:date>2019-04-18T21:28:37Z</dc:date>
    </item>
  </channel>
</rss>

