Results 1 to 5 of 5

Thread: Close a file and don't save changes

  1. #1
    100 Club jgardner.79905's Avatar
    Join Date
    2004-12
    Posts
    153
    Login to Give a bone
    0

    Angry Close a file and don't save changes

    I am having trouble writing a line in lisp that will close a drawing and not save changes. In a sense answering NO when prompted "Do you want to save changes". Can anyone help?

    Thanks Jason

  2. #2
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Close a file and don't save changes

    Are you trying to close the current one? or other open ones?

  3. #3
    100 Club jgardner.79905's Avatar
    Join Date
    2004-12
    Posts
    153
    Login to Give a bone
    0

    Default Re: Close a file and don't save changes

    just the current file

  4. #4
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Close a file and don't save changes

    The problem is that a lisp wants to finish in the drawing it is called in, so you will have to use a call to a VBA statement. Something like
    Code:
    (command "_.vbastmt" (strcat "AcadApplication.ThisDrawing.Close(false,\"" (getvar "dwgname") "\")"))
    This does not work, but maybe someone who knows more VBA can chime in a help with the correct statement.

  5. #5
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Close a file and don't save changes

    Okay, what you need is
    Code:
    (command "_.vbastmt" "ThisDrawing.Close(false)")
    This will close the current drawing without saving it.

Similar Threads

  1. Save and Close Macro
    By mviall681618 in forum AutoLISP
    Replies: 7
    Last Post: 2015-04-25, 08:31 PM
  2. 2014: Transform not maintained after save, close, and reopen
    By elf4au in forum NavisWorks - General
    Replies: 1
    Last Post: 2014-08-21, 08:17 PM
  3. VBA program always prompting to save .DVB on close
    By amy.143074 in forum VBA/COM Interop
    Replies: 12
    Last Post: 2009-03-06, 03:55 PM
  4. Close, relinquish, no save to central
    By ron.sanpedro in forum Revit - Worksharing/Worksets/Revit Server
    Replies: 22
    Last Post: 2007-09-12, 08:43 PM
  5. Zoom Extents, Save and Close starting with a DXF file?
    By j.mathews in forum VBA/COM Interop
    Replies: 5
    Last Post: 2006-10-16, 03:31 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
  •