<?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: Automatically Running a Lisp when Opening Drawings in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12759117#M14380</link>
    <description>&lt;P&gt;Rather than using acaddoc.lsp save as a custom lisp, then just use &lt;STRONG&gt;Appload&lt;/STRONG&gt; and add to &lt;STRONG&gt;Start up Suite&lt;/STRONG&gt;, much easier as you can have code saved in say your directory of lisp programs. My Startup has like 5 lisps loaded on opening CAD.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 May 2024 00:13:31 GMT</pubDate>
    <dc:creator>Sea-Haven</dc:creator>
    <dc:date>2024-05-08T00:13:31Z</dc:date>
    <item>
      <title>Automatically Running a Lisp when Opening Drawings</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12758601#M14376</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get a lisp to run a series of commands when I open a drawing. I found&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;&lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autorunning-a-lisp-depening-on-string-in-file-name/m-p/7639314#M362912" target="_blank" rel="noopener"&gt;this&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt;&amp;nbsp;post from 2017 that had some code on how to do it. I have modified it, and placed it in my acaddoc.lsp file, but it doesn't seem to be working. Can someone point out what I'm doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;-JD&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun-q spstartup () ;Run the following commands on start up of each drawing
  
    (command "snap" "on")
    (command "snap" ".0625")
    (command "ucsicon" "off")
    (command "grid" "off")
    (command "units" "2" "3" "1" "0" "0" "n")
    (command "style" "romans" "romans" "0" "1" "0" "n" "n" "n")
    (command "ZOOM" "E" "")
    (command "DISPLAYVIEWCUBEIN2D" "off")
    (command "_navvcube" "off")
     
)
(setq s::startup (append s::startup spstartup))&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 07 May 2024 18:18:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12758601#M14376</guid>
      <dc:creator>schmidtjBEEVY</dc:creator>
      <dc:date>2024-05-07T18:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Running a Lisp when Opening Drawings</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12758644#M14377</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12582447"&gt;@schmidtjBEEVY&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;.... it doesn't seem to be working. ....&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not enough information.&amp;nbsp; Does any of it happen?&amp;nbsp; How much?&amp;nbsp; Etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;BUT&lt;/STRONG&gt; it doesn't seem necessary to go through the&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt; (defun-q...)&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;approach and the&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt; s::startup&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;business.&amp;nbsp; I expect you could just include lines 3 through 11 in &lt;STRONG&gt;acaddoc.lsp&lt;/STRONG&gt;, just as they are, without "wrapping" them inside anything else.&amp;nbsp; I would also be inclined to use&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt; (setvar)&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;for much of it, rather than&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt; (command)&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;functions, and for those you choose to do with&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt; (command)&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;functions, combine them into one, but that's not essential.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 18:51:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12758644#M14377</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2024-05-07T18:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Running a Lisp when Opening Drawings</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12758724#M14378</link>
      <description>&lt;P&gt;Hi Kent, thanks for your reply!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12582447"&gt;@schmidtjBEEVY&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&lt;SPAN&gt;.... it doesn't seem to be working. ....&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Not enough information.&amp;nbsp; Does any of it happen?&amp;nbsp; How much?&amp;nbsp; Etc.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Ope, yeah that would have been good information up front; none of the commands were making changes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for the rest of your message, I did take them out of the (defun-q) and put them with the rest of the (SETVAR)s in the file. I also changed them from (command)s to (SETVAR)s. It appears that the changes did not occur. A few of them, such as turning the grid off, were already off on the drawing I opened to test the changes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will mess with it some more tomorrow to see if I can get it working, thanks for the suggestion, Kent!&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 19:33:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12758724#M14378</guid>
      <dc:creator>schmidtjBEEVY</dc:creator>
      <dc:date>2024-05-07T19:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Running a Lisp when Opening Drawings</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12758763#M14379</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12582447"&gt;@schmidtjBEEVY&lt;/a&gt;&amp;nbsp;wrote:
&lt;P class="1715111198789"&gt;....&amp;nbsp;I also changed them from (command)s to (SETVAR)s. It appears that the changes did not occur. ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just guessing here....&amp;nbsp; Did you perhaps make that change by just changing the function name?&amp;nbsp; This, for example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(setvar "snap" ".0625")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;would not work.&amp;nbsp; The System Variable names are not necessarily the same as the command names, and numerical values would not be text strings.&amp;nbsp; That one would need to be done this way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(setvar 'snapunit '(0.0625 0.0625))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[Note that there are &lt;EM&gt;two&lt;/EM&gt; numbers in a list -- Snap can have different increments in the X &amp;amp; Y directions.]&amp;nbsp; Find the system variables in Help and use&lt;FONT face="courier new,courier" color="#000000"&gt; (getvar) &lt;/FONT&gt;to see in what format they store their information.&amp;nbsp; For example, some that you set using "On" or "Off" at the command line actually store their values as 1 or 0, and those would be the actual System Variable values you would need to use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And of course, not all of those settings can be done with&lt;FONT face="courier new,courier" color="#000000"&gt; (setvar) &lt;/FONT&gt;at all.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 19:58:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12758763#M14379</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2024-05-07T19:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Running a Lisp when Opening Drawings</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12759117#M14380</link>
      <description>&lt;P&gt;Rather than using acaddoc.lsp save as a custom lisp, then just use &lt;STRONG&gt;Appload&lt;/STRONG&gt; and add to &lt;STRONG&gt;Start up Suite&lt;/STRONG&gt;, much easier as you can have code saved in say your directory of lisp programs. My Startup has like 5 lisps loaded on opening CAD.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 00:13:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12759117#M14380</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-05-08T00:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Running a Lisp when Opening Drawings</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12760068#M14381</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Rather than using acaddoc.lsp ... just use &lt;STRONG&gt;Appload&lt;/STRONG&gt; and add to &lt;STRONG&gt;Start up Suite&lt;/STRONG&gt;, much easier ....&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;[In my opinion, acaddoc.lsp is the easier way, especially when it comes to upgrading to a new version.&amp;nbsp; You don't need to go into APPLOAD and populate the Startup Suite with multiple things, but merely to put your acaddoc.lsp file into some place where AutoCAD knows to look, which you could presumably do even before you first open any drawing in the new version.&amp;nbsp; And you can put direct operations in it as in this topic, without their needing to be defined into .lsp files as is needed to put them in the Startup Suite.&amp;nbsp; Also, the Startup Suite is described as being run &lt;EM&gt;on startup&lt;/EM&gt;&amp;nbsp;of the program -- hence the name -- but &lt;EM&gt;not&lt;/EM&gt; on opening or creating every drawing as acaddoc.lsp does.&amp;nbsp; It seems in trials that at least some things you can put in there are available in every drawing anyway, but I am reluctant to trust that &lt;EM&gt;everything&lt;/EM&gt; would be.]&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 10:38:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12760068#M14381</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2024-05-08T10:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Running a Lisp when Opening Drawings</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12760118#M14382</link>
      <description>&lt;P&gt;How would I write the (defun) instruction such that I don't need to type in the command? I already have a few lisps in my startup suite, but they all require being called from the command line. They don't just run when I open a drawing.&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 11:13:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12760118#M14382</guid>
      <dc:creator>schmidtjBEEVY</dc:creator>
      <dc:date>2024-05-08T11:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Running a Lisp when Opening Drawings</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12760246#M14383</link>
      <description>&lt;P&gt;As code in your&amp;nbsp;&lt;SPAN&gt;startup suite, acad.lsp or acaddoc.lsp is run automatically you could either add (C:function) for code that would normally be run when "function" was entered at the command line.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As defun is for defining functions to be called later you shouldn't need to defun code that's being automatically run anyway.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 12:26:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12760246#M14383</guid>
      <dc:creator>TomBeauford</dc:creator>
      <dc:date>2024-05-08T12:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Running a Lisp when Opening Drawings</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12760253#M14384</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12582447"&gt;@schmidtjBEEVY&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;How would I write the (defun) instruction such that I don't need to type in the command? I already have a few lisps in my startup suite, but they all require being called from the command line. They don't just run when I open a drawing.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;See Message 2.&amp;nbsp; It's an advantage of &lt;STRONG&gt;acaddoc.lsp&lt;/STRONG&gt; that if you put those lines [or the&lt;FONT face="courier new,courier" color="#000000"&gt; (setvar) &lt;/FONT&gt;equivalents of some of them] into it "raw," they will just run upon opening or creating any drawing, with no&lt;FONT face="courier new,courier" color="#000000"&gt; (defun)&lt;/FONT&gt;ition of a command or function name needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp; Or, I find that you can do the same in a file that can be in the Startup Suite, if you prefer that middle-man approach.&amp;nbsp; Just put those operations "raw" into that file, with no "wrapping"&lt;FONT face="courier new,courier" color="#000000"&gt; (defun) &lt;/FONT&gt;function, and the same will happen.&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 12:34:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12760253#M14384</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2024-05-08T12:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Running a Lisp when Opening Drawings</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12760459#M14385</link>
      <description>Ohhhhh, ok, I didn't fully understand message 2 until now. I thought you meant to say I cannot put raw (command)s in the acaddoc and that they had to be in the form of a (setvar). I was able to get it working with using (command)s.&lt;BR /&gt;Thank you for your help, everyone! (Especially you, Kent)</description>
      <pubDate>Wed, 08 May 2024 13:41:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12760459#M14385</guid>
      <dc:creator>schmidtjBEEVY</dc:creator>
      <dc:date>2024-05-08T13:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Running a Lisp when Opening Drawings</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12761742#M14386</link>
      <description>&lt;P&gt;Just a comment been using "start up suite" for as long as I can remember, I use a setup lsp when doing new installs, which sets paths, loads menu's etc, yes need to add to the startup suite as part of setup.&amp;nbsp; For Bricscad its in a directory C:\USER\xxx\appdata\Roaming\Bricysys..... \appload.dfs and is a dfs text file. Expect same for Acad. Using custom mnu you can take advantage of MNL files that say autoload matching lisp programs. NOTE I believe Acad LT 2024 does not support MNL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 01:59:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatically-running-a-lisp-when-opening-drawings/m-p/12761742#M14386</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-05-09T01:59:58Z</dc:date>
    </item>
  </channel>
</rss>

