See the top rated post in this thread. Click here

Results 1 to 7 of 7

Thread: Load .lsp file each time I open a .dwg file?

  1. #1
    100 Club
    Join Date
    2005-04
    Posts
    112
    Login to Give a bone
    0

    Question Load .lsp file each time I open a .dwg file?

    Version AutoCAD 2018

    First, I am a LISP newbie-- I have no experience using/creating LISP files/routines until yesterday.

    I am using a .lsp file that automates the process of ZOOM> EXTENTS in all Layout tabs. The routine works; I invoke the routine by clicking on a toolbar button I created with the macro: ^C^C_zea;
    But I have to APPLOAD the particular .lsp file each time I open a drawing file, in order for the routine to work. If I don't, I get the unknown command message for "ZEA".
    How can I have the .lsp file automatically load for the opening of any .dwg file?

    Thanks
    Last edited by rbdome; 2017-05-09 at 09:39 PM.

  2. #2
    I could stop if I wanted to
    Join Date
    2015-10
    Location
    Central New Jersey
    Posts
    439
    Login to Give a bone
    1

    Default Re: Load .lsp file each time I open a .dwg file?

    I believe in the Appload window there is a Startup Suite, you can add it there to be loaded every time.

    I preference is to put lisps on a toolpallet and load them and run them on the fly with a single 'click' and only as needed. I share the pallet with other users with a brief description of what each one does.

  3. #3
    100 Club
    Join Date
    2005-04
    Posts
    112
    Login to Give a bone
    0

    Default Re: Load .lsp file each time I open a .dwg file?

    just added the lisp file to the Startup Suite in the APPLOAD Dialog. It works. Thanks.

  4. #4
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    560
    Login to Give a bone
    0

    Default Re: Load .lsp file each time I open a .dwg file?

    Make a library of all the lisps you use and then load just that one, ie just paste into one lisp file, also look at the AUTOLOAD command again this is in our library lisp and demand loads lisp's.

  5. #5
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    1

    Default Re: Load .lsp file each time I open a .dwg file?

    I'm surprised no one has mentioned creating an Acaddoc.lsp for auto-loading (and demand-loading) lisp routines, as well as setting variables.
    This is way more reliable then the "startup suite".

    Just do a search here in AUGI, also discussed HERE

  6. #6
    Member stu1037's Avatar
    Join Date
    2005-03
    Location
    ...between bike rides...
    Posts
    45
    Login to Give a bone
    0

    Default Re: Load .lsp file each time I open a .dwg file?

    Quote Originally Posted by rbdome View Post
    Version AutoCAD 2018

    First, I am a LISP newbie-- I have no experience using/creating LISP files/routines until yesterday.

    I am using a .lsp file that automates the process of ZOOM> EXTENTS in all Layout tabs. The routine works; I invoke the routine by clicking on a toolbar button I created with the macro: ^C^C_zea;
    But I have to APPLOAD the particular .lsp file each time I open a drawing file, in order for the routine to work. If I don't, I get the unknown command message for "ZEA".
    How can I have the .lsp file automatically load for the opening of any .dwg file?

    Thanks
    Strangely enough, I'm looking for a LISP to cycle through tabs and ZOOM EXTENTS. Could you share yours, please? I'm hoping to modify it for many other uses.

    Thank you!
    Stu

  7. #7
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    560
    Login to Give a bone
    0

    Default Re: Load .lsp file each time I open a .dwg file?

    Here is an example, you may want to look at this as well its a GOTO for jumping to a specific layout. http://www.cadtutor.net/forum/showth...ts-Goto-layout

    Code:
    ;; Zoom extents in All Layouts (excluding Model)
      ;; Alan J. Thompson
      (or *Acad* (setq *Acad* (vlax-get-acad-object)))
      (or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument *Acad*)))
      ((lambda (ctab)
         (foreach layout (layoutlist)
           (setvar 'ctab layout)
           (vla-put-mspace *AcadDoc* :vlax-false)
           (vla-zoomextents *Acad*)
         )
         (setvar 'ctab ctab)
       )
        (getvar 'ctab)
      )
      (princ)

Similar Threads

  1. Replies: 13
    Last Post: 2016-12-29, 05:44 PM
  2. File open takes more time!
    By venkipala in forum AutoLISP
    Replies: 4
    Last Post: 2010-07-12, 05:21 AM
  3. 9.1 keeps upgrading file every time I open it
    By jwilhelm in forum Revit Architecture - General
    Replies: 3
    Last Post: 2006-10-15, 02:39 AM
  4. Is there a way to prevent AutoCAD from creating a .ds$ file every time I open a SS
    By robert.1.hall72202 in forum AutoCAD Sheet Set Manager
    Replies: 2
    Last Post: 2006-08-24, 05:53 PM
  5. Multiple views open upon file load???
    By patricks in forum Revit Architecture - General
    Replies: 2
    Last Post: 2006-05-11, 01:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •