<?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: Pass lisp variable to batch file that requires arguments in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/pass-lisp-variable-to-batch-file-that-requires-arguments/m-p/8307274#M164224</link>
    <description>&lt;P&gt;is it something that can be passed like a file switch?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/start-app-and-pass-a-variable/td-p/819028" target="_blank"&gt;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/start-app-and-pass-a-variable/td-p/819028&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Oct 2018 13:44:20 GMT</pubDate>
    <dc:creator>TheCADnoob</dc:creator>
    <dc:date>2018-10-02T13:44:20Z</dc:date>
    <item>
      <title>Pass lisp variable to batch file that requires arguments</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/pass-lisp-variable-to-batch-file-that-requires-arguments/m-p/8305545#M164223</link>
      <description>&lt;P&gt;I have a batch file i am calling from a lisp. It requires an argument that I want to pass from the lisp. How do I do this? I'm using the (startapp "filename.ext") function to call the batch file from a lisp.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 19:48:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/pass-lisp-variable-to-batch-file-that-requires-arguments/m-p/8305545#M164223</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-01T19:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Pass lisp variable to batch file that requires arguments</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/pass-lisp-variable-to-batch-file-that-requires-arguments/m-p/8307274#M164224</link>
      <description>&lt;P&gt;is it something that can be passed like a file switch?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/start-app-and-pass-a-variable/td-p/819028" target="_blank"&gt;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/start-app-and-pass-a-variable/td-p/819028&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 13:44:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/pass-lisp-variable-to-batch-file-that-requires-arguments/m-p/8307274#M164224</guid>
      <dc:creator>TheCADnoob</dc:creator>
      <dc:date>2018-10-02T13:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Pass lisp variable to batch file that requires arguments</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/pass-lisp-variable-to-batch-file-that-requires-arguments/m-p/8311354#M164225</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@Anonymous&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could add some code to your lisp routine that will write a new temporary batch file containing a call to the main batch file with the arguments you want and then execute the temporary batch file using AutoCAD's SHELL command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You did not specify the name of your batch file or the nature of the arguments you wanted to pass to it so here is a generic example with 2 arguments stored in variables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(setq file_id (open "c:\\your path\\your temp batch.bat" "w"))
(write-line (strcat "\"c:\\your path\\your batch.bat\" " your_first_argument_string " " your_next_argument_string) file_id)
(close file_id)
(command "shell" "\"c:\\your path\\your temp batch.bat\"")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 22:38:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/pass-lisp-variable-to-batch-file-that-requires-arguments/m-p/8311354#M164225</guid>
      <dc:creator>Paul_Gander</dc:creator>
      <dc:date>2018-10-03T22:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Pass lisp variable to batch file that requires arguments</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/pass-lisp-variable-to-batch-file-that-requires-arguments/m-p/8311357#M164226</link>
      <description>Thank you.&amp;nbsp; I will try to test soon.&amp;nbsp;</description>
      <pubDate>Wed, 03 Oct 2018 22:40:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/pass-lisp-variable-to-batch-file-that-requires-arguments/m-p/8311357#M164226</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-03T22:40:35Z</dc:date>
    </item>
  </channel>
</rss>

