<?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 Making a function run when a lisp code is loaded with appload in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/making-a-function-run-when-a-lisp-code-is-loaded-with-appload/m-p/9667930#M71631</link>
    <description>&lt;P&gt;What I'm trying to do is pretty simple, I have a routine and I want that, when someone loads it into autocad, a pop up appears on the screen with a little explaining of what it does. I know how to do the popup, but I have no idea on how to make it run specifically when the routine is loaded, any suggestions ?&lt;/P&gt;</description>
    <pubDate>Sat, 01 Aug 2020 23:13:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-08-01T23:13:45Z</dc:date>
    <item>
      <title>Making a function run when a lisp code is loaded with appload</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/making-a-function-run-when-a-lisp-code-is-loaded-with-appload/m-p/9667930#M71631</link>
      <description>&lt;P&gt;What I'm trying to do is pretty simple, I have a routine and I want that, when someone loads it into autocad, a pop up appears on the screen with a little explaining of what it does. I know how to do the popup, but I have no idea on how to make it run specifically when the routine is loaded, any suggestions ?&lt;/P&gt;</description>
      <pubDate>Sat, 01 Aug 2020 23:13:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/making-a-function-run-when-a-lisp-code-is-loaded-with-appload/m-p/9667930#M71631</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-01T23:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Making a function run when a lisp code is loaded with appload</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/making-a-function-run-when-a-lisp-code-is-loaded-with-appload/m-p/9668100#M71632</link>
      <description>&lt;LI-CODE lang="general"&gt;(&amp;lt;&amp;lt; Your lisp Code &amp;gt;&amp;gt;)
(alert "Lisp Load Successfully")&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 02 Aug 2020 06:29:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/making-a-function-run-when-a-lisp-code-is-loaded-with-appload/m-p/9668100#M71632</guid>
      <dc:creator>kajanthangavel</dc:creator>
      <dc:date>2020-08-02T06:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Making a function run when a lisp code is loaded with appload</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/making-a-function-run-when-a-lisp-code-is-loaded-with-appload/m-p/9668595#M71633</link>
      <description>&lt;P&gt;It's all about the LSP file you load.&amp;nbsp; It should be structured something like this:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(vl-load-com)
;; Define any global functions you want to use
(defun function1 (local1 local2)
   ;; blah blah
)
(defun function2 (local1 local2)
   ;; blah blah
)
;; This is the custom command you want to run:
(defun c:RUN (/ this that)
  (setq this "this" that "that")
  (function1 this nil)
  (function2 nil that)
  (command "_.dosomething")
  (princ)
)
;; Invoke the custom command:
(c:RUN)
(princ) ;; end of AutoLisp file&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 02 Aug 2020 18:12:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/making-a-function-run-when-a-lisp-code-is-loaded-with-appload/m-p/9668595#M71633</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2020-08-02T18:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Making a function run when a lisp code is loaded with appload</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/making-a-function-run-when-a-lisp-code-is-loaded-with-appload/m-p/9669610#M71634</link>
      <description>&lt;P&gt;If it's something you want to do &lt;EM&gt;only once&lt;/EM&gt;, and &lt;EM&gt;immediately upon loading&lt;/EM&gt;, and don't need to be able to type in a command name later to do it again, then you can skip defining it into a command and then invoking that command, and just &lt;EM&gt;&lt;STRONG&gt;do it directly&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp; The entire file could be something like this, with no (defun)'s at all:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(alert "This routine honks the horn\nand rolls down the windows.")

(setq cmde (getvar 'cmdecho))

(setvar 'cmdecho 0)

(setq

  option1 (getwhatever this that other)

  point1 (getpoint "\nLocation: ")

  option2 (getsomething "'nTell me about it: ")

  point2 (getpoint "nOther location: ")

)

(command

  "_.this" option1 point1

  "_.that" option2 point2 "stringA"

  "_.qsave"

)

(setvar 'cmdecho 1)

(princ)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 03 Aug 2020 14:16:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/making-a-function-run-when-a-lisp-code-is-loaded-with-appload/m-p/9669610#M71634</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-08-03T14:16:11Z</dc:date>
    </item>
  </channel>
</rss>

