<?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: Batch process dxf files. in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-process-dxf-files/m-p/12658140#M16041</link>
    <description>&lt;P&gt;No I don't.&lt;/P&gt;&lt;P&gt;With help from IA I have made the code below that works when you have the dxf file open, but I don't know how to make it work in automatic, looking for all the dxf files in a directory, open them, apply the lisp, save close them.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:modifyDrawing (/ ss ent lay rad)
  (setq ss (ssget "X" '((8 . "yellow"))))
  (if ss
    (progn
      (command "_.erase" ss "")
      (princ "\nDeleted all entities in layer 'yellow'.")
    )
    (princ "\nNo entities found in layer 'yellow'.")
  )
  (setq ss (ssget "X" '((0 . "CIRCLE"))))
  (if ss
    (progn
      (repeat (setq i (sslength ss))
        (setq ent (ssname ss (setq i (1- i))))
        (setq rad (cdr (assoc 40 (entget ent))))
        (if (and (&amp;gt;= rad 3.9) (&amp;lt;= rad 4.1)) ; check for radius within tolerance
          (entmod (subst (cons 40 3) (assoc 40 (entget ent)) (entget ent)))
        )
      )
      (princ "\nChanged all 8mm holes to 6mm.")
    )
    (princ "\nNo 8mm holes found.")
  )
  (princ)
)&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 22 Mar 2024 07:33:28 GMT</pubDate>
    <dc:creator>aurel_e</dc:creator>
    <dc:date>2024-03-22T07:33:28Z</dc:date>
    <item>
      <title>Batch process dxf files.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-process-dxf-files/m-p/12655864#M16039</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;I have got more than 100 dxf files - rectangular plates with some holes.&lt;/P&gt;&lt;P&gt;I would need to 1.delete the layer "YELLOW" elements. 2. Change all 8mm holes to 6mm holes.&lt;/P&gt;&lt;P&gt;Is there any way to do it with a script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Autocad 2024.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 10:50:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-process-dxf-files/m-p/12655864#M16039</guid>
      <dc:creator>aurel_e</dc:creator>
      <dc:date>2024-03-21T10:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Batch process dxf files.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-process-dxf-files/m-p/12657897#M16040</link>
      <description>&lt;P&gt;Yes&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script is to do a dxfin or an insert into current dwg or just open the dxf.&lt;/P&gt;&lt;P&gt;get all objects on layer "yellow " and delete or if acad "Laydel".&lt;/P&gt;&lt;P&gt;Then do a simple lisp to change all 6mm Circles to 8 mm use ssget with filter correct rad=6&lt;/P&gt;&lt;P&gt;Save new dwg with a name. Depending on 1st step method do new dxf.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you understand how to make a SCRipt.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 04:10:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-process-dxf-files/m-p/12657897#M16040</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-03-22T04:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Batch process dxf files.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-process-dxf-files/m-p/12658140#M16041</link>
      <description>&lt;P&gt;No I don't.&lt;/P&gt;&lt;P&gt;With help from IA I have made the code below that works when you have the dxf file open, but I don't know how to make it work in automatic, looking for all the dxf files in a directory, open them, apply the lisp, save close them.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:modifyDrawing (/ ss ent lay rad)
  (setq ss (ssget "X" '((8 . "yellow"))))
  (if ss
    (progn
      (command "_.erase" ss "")
      (princ "\nDeleted all entities in layer 'yellow'.")
    )
    (princ "\nNo entities found in layer 'yellow'.")
  )
  (setq ss (ssget "X" '((0 . "CIRCLE"))))
  (if ss
    (progn
      (repeat (setq i (sslength ss))
        (setq ent (ssname ss (setq i (1- i))))
        (setq rad (cdr (assoc 40 (entget ent))))
        (if (and (&amp;gt;= rad 3.9) (&amp;lt;= rad 4.1)) ; check for radius within tolerance
          (entmod (subst (cons 40 3) (assoc 40 (entget ent)) (entget ent)))
        )
      )
      (princ "\nChanged all 8mm holes to 6mm.")
    )
    (princ "\nNo 8mm holes found.")
  )
  (princ)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 22 Mar 2024 07:33:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-process-dxf-files/m-p/12658140#M16041</guid>
      <dc:creator>aurel_e</dc:creator>
      <dc:date>2024-03-22T07:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Batch process dxf files.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-process-dxf-files/m-p/12660172#M16042</link>
      <description>&lt;P&gt;In simple terms a script is just a sequence of command including lisp.&lt;/P&gt;&lt;P&gt;It would look something like this so do manually and write down all steps including enter's which are spaces in a script or a new blak line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;dxfin "dxf1"
(load "mydxffixer")
(c:modifyDrawing)
save "DXF1"
close Y
dxfin "dxf2"
(load "mydxffixer")
(c:modifyDrawing)
save "DXF2"
Close y&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are various ways to get a list of dxf file names. I would look at Lee-mac script writer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2024 03:30:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-process-dxf-files/m-p/12660172#M16042</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-03-23T03:30:41Z</dc:date>
    </item>
  </channel>
</rss>

