3 Replies Latest reply on Oct 17, 2013 5:24 AM by Simon Turner

    SaveAs does not fire event OnSaveAs

    Zajc Markus



      i do not get any SaveAs event when calling IModelDoc2::SaveAs4 with full parameter list. Is this a known problem ?

      We already try different options in the call and also SaveAsFileName togehter with SaveAsNotify2 but not hit anyway.


      When i put a breakpoint in my event handler it gets hit while using the UI and call SaveAs so it seems to be a API problem.


      Any Hint or idea? We found not way except saveas to set the filename for a document.


      Solidworks 2012 64 Bit SP0.0




        • Re: SaveAs does not fire event OnSaveAs
          Jacob Corder

          I am assuming it acts like partdoc.UserSelectionPostNotify, which only fires when an individual makes a selection with the mouse, vs Partdoc.NewSelectionNotify which fires whenever a selection is made in the apI or user interface.


          To fix this, just call the event

          Depending on if you want to fire the event before or after you save determines where you call the event.


          To call the event just call the events function like

          Eventhandler.FileSaveAs2 ( fill in the arguments here) if you are using the api, I wouldn't want solidworks to break into pause my application to notify me of something I know that im doing, like calling saveAs. You know your calling save as so just call the function that the event calls. This way if your application calls the event vs the user, you get the same outcome, which is what you are looking to get here I believe.