13 Replies Latest reply on Dec 7, 2010 1:30 PM by Samu Niveri

    How to close open documents without saving?

    Filipe Venceslau

      I can't seem to get solidworks to close documents without asking user to save changes.

      I've set UserControl to True, even tried running with UserControlBackground, but everytime I close a document that is "dirty", solidworks prompts user to save.

      This happens mostly with drawings.

       

      Here's my code...

       

       

              If Not myApp Is Nothing Then
                  'closes all documents in memory without saving
                  For Each OpenDoc As ModelDoc2 In myApp.GetDocuments
                      myApp.QuitDoc(OpenDoc.GetTitle)
                  Next
              End If

       

       

      In the API help, it clearly says...to use QuitDoc Method (ISldWorks)...and that it should close without saving...so why am I getting a dialog prompt to save?

       

      Note: I'm not creating a solidworks instance, I'm just getting the current open one...would that make any difference?

       

      Thanks