<?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: AutoLisp Loading in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-loading/m-p/1988116#M148394</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
There are several ways.&lt;BR /&gt;
&lt;BR /&gt;
Answer the questions for yourself:&lt;BR /&gt;
&lt;BR /&gt;
Do you want it to load for every drawing, or just every session?&lt;BR /&gt;
&lt;BR /&gt;
Do you create your own custom menu/toolbars for your customisation?  It is&lt;BR /&gt;
very strongly recommended that you do.&lt;BR /&gt;
&lt;BR /&gt;
If you want every drawing and you have a custom menu, then create an MNL&lt;BR /&gt;
file containing your code (MNL is simply a lisp file with an MNL extension)&lt;BR /&gt;
and having the same name as the menu file and in the same directory.  This&lt;BR /&gt;
file will load when the menu is loaded.&lt;BR /&gt;
&lt;BR /&gt;
Other alternatives copied from the help files.&lt;BR /&gt;
&lt;BR /&gt;
The ACAD.LSP File&lt;BR /&gt;
     Concept   Quick Reference&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
You can create an acad.lsp file if you regularly use specific AutoLISP&lt;BR /&gt;
routines. When you start AutoCAD, it searches the support file search path&lt;BR /&gt;
for an acad.lsp file. If an acad.lsp file is found, it is loaded into&lt;BR /&gt;
memory.&lt;BR /&gt;
&lt;BR /&gt;
The acad.lsp file is loaded at each drawing session startup when AutoCAD is&lt;BR /&gt;
launched. Because the acad.lsp file is intended to be used for&lt;BR /&gt;
application-specific startup routines, all functions and variables defined&lt;BR /&gt;
in an acad.lsp file are only available in the first drawing. You will&lt;BR /&gt;
probably want to move routines that should be available in all documents&lt;BR /&gt;
from your acad.lsp file into the acaddoc.lsp file.&lt;BR /&gt;
&lt;BR /&gt;
The recommended functionality of acad.lsp and acaddoc.lsp can be overridden&lt;BR /&gt;
with the ACADLSPASDOC system variable. If the ACADLSPASDOC system variable&lt;BR /&gt;
is set to 0 (the default setting), the acad.lsp file is loaded just once:&lt;BR /&gt;
upon application startup. If ACADLSPASDOC is set to 1, the acad.lsp file is&lt;BR /&gt;
reloaded with each new drawing.&lt;BR /&gt;
&lt;BR /&gt;
The acad.lsp file can contain AutoLISP code for one or more routines, or&lt;BR /&gt;
just a series of load function calls. The latter method is preferable,&lt;BR /&gt;
because modification is easier. If you save the following code as an&lt;BR /&gt;
acad.lsp file, the files mysessionapp1.lsp, databasesynch.lsp, and&lt;BR /&gt;
drawingmanager.lsp are loaded every time you start AutoCAD.&lt;BR /&gt;
&lt;BR /&gt;
(load "mysessionapp1")(load "databasesynch")(load "drawingmanager")WarningDo&lt;BR /&gt;
not modify the reserved acad2008.lsp file. Autodesk provides the&lt;BR /&gt;
acad2008.lsp file, which contains AutoLISP defined functions that are&lt;BR /&gt;
required by AutoCAD. This file is loaded into memory immediately before the&lt;BR /&gt;
acad.lsp file is loaded.&lt;BR /&gt;
See Also&lt;BR /&gt;
or:&lt;BR /&gt;
&lt;BR /&gt;
The ACADDOC.LSP File&lt;BR /&gt;
     Concept   Quick Reference&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The acaddoc.lsp file is intended to be associated with each document (or&lt;BR /&gt;
drawing) initialization. This file is useful if you want to load a library&lt;BR /&gt;
of AutoLISP routines to be available every time you start a new drawing (or&lt;BR /&gt;
open an existing drawing).&lt;BR /&gt;
&lt;BR /&gt;
Each time a drawing opens, AutoCAD searches the library path for an&lt;BR /&gt;
acaddoc.lsp file. If it finds one, it loads the file into memory. The&lt;BR /&gt;
acaddoc.lsp file is always loaded with each drawing regardless of the&lt;BR /&gt;
settings of ACADLSPASDOC.&lt;BR /&gt;
&lt;BR /&gt;
Most users will have a single acaddoc.lsp file for all document-based&lt;BR /&gt;
AutoLISP routines. AutoCAD searches for an acaddoc.lsp file in the order&lt;BR /&gt;
defined by the library path; therefore, with this feature, you can have a&lt;BR /&gt;
different acaddoc.lsp file in each drawing directory, which would load&lt;BR /&gt;
specific AutoLISP routines for certain types of drawings or jobs.&lt;BR /&gt;
&lt;BR /&gt;
The acaddoc.lsp file can contain AutoLISP code for one or more routines, or&lt;BR /&gt;
just a series of load function calls. The latter method is preferable,&lt;BR /&gt;
because modification is easier. If you save the following code as an&lt;BR /&gt;
acaddoc.lsp file, the files mydocumentapp1.lsp, build.lsp, and counter.lsp&lt;BR /&gt;
are loaded every time a new document is opened.&lt;BR /&gt;
&lt;BR /&gt;
(load "mydocumentapp1")(load "build")(load "counter")WarningDo not modify&lt;BR /&gt;
the reserved acad2008doc.lsp file. Autodesk provides the acad2008doc.lsp&lt;BR /&gt;
file, which contains AutoLISP-defined functions that are required by&lt;BR /&gt;
AutoCAD. This file is loaded into memory immediately before the acaddoc.lsp&lt;BR /&gt;
file is loaded.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
&lt;BR /&gt;
Laurie Comerford&lt;BR /&gt;
CADApps&lt;BR /&gt;
www.cadapps.com.au&lt;BR /&gt;
www.civil3Dtools.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;CADNJ&gt; wrote in message news:5618578@discussion.autodesk.com...&lt;BR /&gt;
How can you have your custom AutoLisp files to load everytime you start a&lt;BR /&gt;
session vs drag-drop method?&lt;/CADNJ&gt;</description>
    <pubDate>Wed, 06 Jun 2007 19:57:41 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-06-06T19:57:41Z</dc:date>
    <item>
      <title>AutoLisp Loading</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-loading/m-p/1988113#M148391</link>
      <description>How can you have your custom AutoLisp files to load everytime you start a session vs drag-drop method?</description>
      <pubDate>Wed, 06 Jun 2007 19:23:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-loading/m-p/1988113#M148391</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-06-06T19:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLisp Loading</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-loading/m-p/1988114#M148392</link>
      <description>type in "appload" click 'startup suite' and add whatever you like.&lt;BR /&gt;
&lt;BR /&gt;
-------------&lt;BR /&gt;
http://www.CADgasm.tk/</description>
      <pubDate>Wed, 06 Jun 2007 19:55:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-loading/m-p/1988114#M148392</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-06-06T19:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLisp Loading</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-loading/m-p/1988115#M148393</link>
      <description>there are many ways to accomplish this...&lt;BR /&gt;
a) you can add them in your cui file under lisps&lt;BR /&gt;
b) if you have a enterprise menu everyone is loading you can create a "yourcuiname.mnl" file which loads with the cui file and program autoloads in the mnl file.&lt;BR /&gt;
c) you can use the "startup suite" located in the appload command. (not recommended)&lt;BR /&gt;
I have many routines defined in a fas file which gets loaded by our mnl menu file and I also use it to load others with this (autoload "Sqft" '("sqft")). This little trick will not load the routine until the command is envoked in this case "Sqft" is a lisp routine located in our search paths and "sqft" at the command prompt will load and run routine.&lt;BR /&gt;
B</description>
      <pubDate>Wed, 06 Jun 2007 19:56:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-loading/m-p/1988115#M148393</guid>
      <dc:creator>bnarum1</dc:creator>
      <dc:date>2007-06-06T19:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLisp Loading</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-loading/m-p/1988116#M148394</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
There are several ways.&lt;BR /&gt;
&lt;BR /&gt;
Answer the questions for yourself:&lt;BR /&gt;
&lt;BR /&gt;
Do you want it to load for every drawing, or just every session?&lt;BR /&gt;
&lt;BR /&gt;
Do you create your own custom menu/toolbars for your customisation?  It is&lt;BR /&gt;
very strongly recommended that you do.&lt;BR /&gt;
&lt;BR /&gt;
If you want every drawing and you have a custom menu, then create an MNL&lt;BR /&gt;
file containing your code (MNL is simply a lisp file with an MNL extension)&lt;BR /&gt;
and having the same name as the menu file and in the same directory.  This&lt;BR /&gt;
file will load when the menu is loaded.&lt;BR /&gt;
&lt;BR /&gt;
Other alternatives copied from the help files.&lt;BR /&gt;
&lt;BR /&gt;
The ACAD.LSP File&lt;BR /&gt;
     Concept   Quick Reference&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
You can create an acad.lsp file if you regularly use specific AutoLISP&lt;BR /&gt;
routines. When you start AutoCAD, it searches the support file search path&lt;BR /&gt;
for an acad.lsp file. If an acad.lsp file is found, it is loaded into&lt;BR /&gt;
memory.&lt;BR /&gt;
&lt;BR /&gt;
The acad.lsp file is loaded at each drawing session startup when AutoCAD is&lt;BR /&gt;
launched. Because the acad.lsp file is intended to be used for&lt;BR /&gt;
application-specific startup routines, all functions and variables defined&lt;BR /&gt;
in an acad.lsp file are only available in the first drawing. You will&lt;BR /&gt;
probably want to move routines that should be available in all documents&lt;BR /&gt;
from your acad.lsp file into the acaddoc.lsp file.&lt;BR /&gt;
&lt;BR /&gt;
The recommended functionality of acad.lsp and acaddoc.lsp can be overridden&lt;BR /&gt;
with the ACADLSPASDOC system variable. If the ACADLSPASDOC system variable&lt;BR /&gt;
is set to 0 (the default setting), the acad.lsp file is loaded just once:&lt;BR /&gt;
upon application startup. If ACADLSPASDOC is set to 1, the acad.lsp file is&lt;BR /&gt;
reloaded with each new drawing.&lt;BR /&gt;
&lt;BR /&gt;
The acad.lsp file can contain AutoLISP code for one or more routines, or&lt;BR /&gt;
just a series of load function calls. The latter method is preferable,&lt;BR /&gt;
because modification is easier. If you save the following code as an&lt;BR /&gt;
acad.lsp file, the files mysessionapp1.lsp, databasesynch.lsp, and&lt;BR /&gt;
drawingmanager.lsp are loaded every time you start AutoCAD.&lt;BR /&gt;
&lt;BR /&gt;
(load "mysessionapp1")(load "databasesynch")(load "drawingmanager")WarningDo&lt;BR /&gt;
not modify the reserved acad2008.lsp file. Autodesk provides the&lt;BR /&gt;
acad2008.lsp file, which contains AutoLISP defined functions that are&lt;BR /&gt;
required by AutoCAD. This file is loaded into memory immediately before the&lt;BR /&gt;
acad.lsp file is loaded.&lt;BR /&gt;
See Also&lt;BR /&gt;
or:&lt;BR /&gt;
&lt;BR /&gt;
The ACADDOC.LSP File&lt;BR /&gt;
     Concept   Quick Reference&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The acaddoc.lsp file is intended to be associated with each document (or&lt;BR /&gt;
drawing) initialization. This file is useful if you want to load a library&lt;BR /&gt;
of AutoLISP routines to be available every time you start a new drawing (or&lt;BR /&gt;
open an existing drawing).&lt;BR /&gt;
&lt;BR /&gt;
Each time a drawing opens, AutoCAD searches the library path for an&lt;BR /&gt;
acaddoc.lsp file. If it finds one, it loads the file into memory. The&lt;BR /&gt;
acaddoc.lsp file is always loaded with each drawing regardless of the&lt;BR /&gt;
settings of ACADLSPASDOC.&lt;BR /&gt;
&lt;BR /&gt;
Most users will have a single acaddoc.lsp file for all document-based&lt;BR /&gt;
AutoLISP routines. AutoCAD searches for an acaddoc.lsp file in the order&lt;BR /&gt;
defined by the library path; therefore, with this feature, you can have a&lt;BR /&gt;
different acaddoc.lsp file in each drawing directory, which would load&lt;BR /&gt;
specific AutoLISP routines for certain types of drawings or jobs.&lt;BR /&gt;
&lt;BR /&gt;
The acaddoc.lsp file can contain AutoLISP code for one or more routines, or&lt;BR /&gt;
just a series of load function calls. The latter method is preferable,&lt;BR /&gt;
because modification is easier. If you save the following code as an&lt;BR /&gt;
acaddoc.lsp file, the files mydocumentapp1.lsp, build.lsp, and counter.lsp&lt;BR /&gt;
are loaded every time a new document is opened.&lt;BR /&gt;
&lt;BR /&gt;
(load "mydocumentapp1")(load "build")(load "counter")WarningDo not modify&lt;BR /&gt;
the reserved acad2008doc.lsp file. Autodesk provides the acad2008doc.lsp&lt;BR /&gt;
file, which contains AutoLISP-defined functions that are required by&lt;BR /&gt;
AutoCAD. This file is loaded into memory immediately before the acaddoc.lsp&lt;BR /&gt;
file is loaded.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
&lt;BR /&gt;
Laurie Comerford&lt;BR /&gt;
CADApps&lt;BR /&gt;
www.cadapps.com.au&lt;BR /&gt;
www.civil3Dtools.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;CADNJ&gt; wrote in message news:5618578@discussion.autodesk.com...&lt;BR /&gt;
How can you have your custom AutoLisp files to load everytime you start a&lt;BR /&gt;
session vs drag-drop method?&lt;/CADNJ&gt;</description>
      <pubDate>Wed, 06 Jun 2007 19:57:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-loading/m-p/1988116#M148394</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-06-06T19:57:41Z</dc:date>
    </item>
  </channel>
</rss>

