Results 1 to 3 of 3

Thread: Auto running a command.

  1. #1
    Member
    Join Date
    2004-07
    Posts
    2
    Login to Give a bone
    0

    Default Auto running a command.

    Hi,

    Is it possible to have a command run automatically when a drawing is loaded. I have a lisp routine that would run when the drawing is loaded without having to run it manually.

    I imagine it can but I can't seem to find anywhere how to do it.

    Thanks
    Bob

  2. #2
    AUGI Addict Glenn Pope's Avatar
    Join Date
    2001-05
    Location
    Austin, TX USA
    Posts
    2,201
    Login to Give a bone
    0

    Default Re: Auto running a command.

    This is pretty simple to do.

    In the same lsp file as your routine, at the very end add the name of the routine in parentheses.

    (NameOfRoutine)

  3. #3
    AUGI Addict sinc's Avatar
    Join Date
    2004-02
    Location
    Colorado
    Posts
    1,986
    Login to Give a bone
    0

    Default Re: Auto running a command.

    ...and if you haven't already done it, you need to tell AutoCAD to load the file when it loads a drawing by putting the following line in your acaddoc.lsp file (you will likely need to create the file, and put it into a directory in your support file search path):

    (load "mylispfile")

Similar Threads

  1. 2014: How t o highlight an element while the command is running
    By kukuzry in forum Revit - API
    Replies: 2
    Last Post: 2014-07-08, 01:13 AM
  2. Running a command for each line of a list.
    By LSElite in forum AutoLISP
    Replies: 3
    Last Post: 2013-01-14, 10:20 AM
  3. Auto loading a LSP but not auto running it
    By MTristram in forum AutoCAD Customization
    Replies: 4
    Last Post: 2012-10-05, 04:16 AM
  4. auto running lisp
    By PHOTOS4ME in forum AutoLISP
    Replies: 3
    Last Post: 2009-07-31, 07:21 PM
  5. Running LISP command
    By KGC in forum AutoLISP
    Replies: 17
    Last Post: 2007-12-18, 11: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
  •