<?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 expression for OPEN or INSERT in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-expression-for-open-or-insert/m-p/5580790#M142451</link>
    <description>&lt;P&gt;You're welcome, tmccar.&lt;BR /&gt;Glad you got it sorted!&lt;BR /&gt;&lt;BR /&gt;Henrique&lt;/P&gt;</description>
    <pubDate>Fri, 10 Apr 2015 15:33:24 GMT</pubDate>
    <dc:creator>hmsilva</dc:creator>
    <dc:date>2015-04-10T15:33:24Z</dc:date>
    <item>
      <title>Lisp expression for OPEN or INSERT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-expression-for-open-or-insert/m-p/5578719#M142446</link>
      <description>&lt;P&gt;If I&amp;nbsp;enter&amp;nbsp;Lisp expressions on the command line, they get evaluated ok, but not where a filename is required (e.g. for OPEN or INSERT). I get "Invalid file name" when I try to use a "strcat" expression. Is there a way around this?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2015 06:49:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-expression-for-open-or-insert/m-p/5578719#M142446</guid>
      <dc:creator>tmccar</dc:creator>
      <dc:date>2015-04-10T06:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp expression for OPEN or INSERT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-expression-for-open-or-insert/m-p/5578768#M142447</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/450363"&gt;@tmccar&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;If I&amp;nbsp;enter&amp;nbsp;Lisp expressions on the command line, they get evaluated ok, but not where a filename is required (e.g. for OPEN or INSERT). I get "Invalid file name" when I try to use a "strcat" expression. Is there a way around this?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi tmccar,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;your&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;explanation&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is vague&lt;/SPAN&gt;, &lt;SPAN class="hps"&gt;could you&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;please&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;show an &lt;SPAN class="hps alt-edited"&gt;specific&lt;/SPAN&gt; example.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;Using a path in 'LISP', you'll have to enter two backslashes "\\" or a single &lt;SPAN class="hps alt-edited"&gt;slash&lt;/SPAN&gt; "/"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;i.e.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;(strcat "c:\\test\\test\\" "test.dwg")
;; or
(strcat "c:/test/test/" "test.dwg")&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2015 07:52:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-expression-for-open-or-insert/m-p/5578768#M142447</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-04-10T07:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp expression for OPEN or INSERT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-expression-for-open-or-insert/m-p/5578934#M142448</link>
      <description>&lt;P&gt;For instance, I can enter this expression at the command line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(setenv "filedir" "C:/dwgs/")&lt;/P&gt;&lt;P&gt;and then&lt;/P&gt;&lt;P&gt;(strcat (getenv "filedir") "Folder1/cover1.dwg")&lt;/P&gt;&lt;P&gt;and it will corrrectly evaluate the full path so:&lt;/P&gt;&lt;P&gt;C:/dwgsFolder1/cover1.dwg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I would like to enter the expression &lt;EM&gt;&lt;STRONG&gt;(strcat (getenv "filedir") "Folder1/cover1.dwg")&lt;/STRONG&gt; &lt;/EM&gt;in response to the Open or Insert command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2015 08:40:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-expression-for-open-or-insert/m-p/5578934#M142448</guid>
      <dc:creator>tmccar</dc:creator>
      <dc:date>2015-04-10T08:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp expression for OPEN or INSERT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-expression-for-open-or-insert/m-p/5578988#M142449</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/450363"&gt;@tmccar&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I would like to enter the expression &lt;EM&gt;&lt;STRONG&gt;(strcat (getenv "filedir") "Folder1/cover1.dwg")&lt;/STRONG&gt; &lt;/EM&gt;in response to the Open or Insert command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;???&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;PRE&gt;(defun c:demo (/ file)
  (setenv "filedir" "C:/dwgs/")
  (setq file (strcat (getenv "filedir") "Folder1/cover1.dwg"))
  (if (findfile file)
    (command "_.-insert" file "_S" 1 "_R" 0 '(0.0 0.0 0.0))
    (prompt (strcat "\n" file " was not found! "))
  )
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2015 08:58:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-expression-for-open-or-insert/m-p/5578988#M142449</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-04-10T08:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp expression for OPEN or INSERT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-expression-for-open-or-insert/m-p/5579023#M142450</link>
      <description>&lt;P&gt;Thanks Henrique - I had forgotten to set TEXTEVAL to 1&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2015 09:48:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-expression-for-open-or-insert/m-p/5579023#M142450</guid>
      <dc:creator>tmccar</dc:creator>
      <dc:date>2015-04-10T09:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp expression for OPEN or INSERT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-expression-for-open-or-insert/m-p/5580790#M142451</link>
      <description>&lt;P&gt;You're welcome, tmccar.&lt;BR /&gt;Glad you got it sorted!&lt;BR /&gt;&lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2015 15:33:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-expression-for-open-or-insert/m-p/5580790#M142451</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-04-10T15:33:24Z</dc:date>
    </item>
  </channel>
</rss>

