Results 1 to 3 of 3

Thread: Run Script When Drawing Closes, Automatically

  1. #1
    Member
    Join Date
    2012-03
    Posts
    8
    Login to Give a bone
    0

    Default Run Script When Drawing Closes, Automatically

    I know scripts can be set up to run when you open a drawing, I do it all the time. Is there a way to set up a script to run automatically when you close a drawing?

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

    Default Re: Run Script When Drawing Closes, Automatically

    Quote Originally Posted by ted.evans551232 View Post
    I know scripts can be set up to run when you open a drawing, I do it all the time. Is there a way to set up a script to run automatically when you close a drawing?
    I would imagine you could add something like that to an Acaddoc.lsp and have it run with the _close command.

  3. #3
    Super Moderator dkoch's Avatar
    Join Date
    2003-03
    Location
    Philadelphia, PA
    Posts
    2,392
    Login to Give a bone
    0

    Default Re: Run Script When Drawing Closes, Automatically

    You could undefine the CLOSE command, and then redefine it with code of your choosing, which, at the end, would call the ._CLOSE command. The initial period tells AutoCAD to run the as-originally-defined-in-the-program version of CLOSE, rather than your redefined version. I have never done that, so you may want to test it out to make certain that all of the various ways of closing a drawing actually invoke the CLOSE command.

Similar Threads

  1. Error closes Revit: An error has occurred while drawing the contents of this window.
    By chasen_forever in forum Revit Architecture - General
    Replies: 6
    Last Post: 2010-05-07, 03:38 PM
  2. Get drawing name from VB Script
    By kmelchor in forum VBA/COM Interop
    Replies: 1
    Last Post: 2009-09-17, 06:27 PM
  3. script not running automatically
    By ccassidy in forum AutoCAD LT - General
    Replies: 7
    Last Post: 2008-09-16, 07:43 PM
  4. Replies: 8
    Last Post: 2008-03-25, 03:12 PM
  5. Redefine Open - automatically run a script upon opening a drawing
    By Mamma Jamma in forum AutoCAD Customization
    Replies: 9
    Last Post: 2005-12-21, 07:33 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
  •