How to avoid auto save during function execution?


#1

Hi,

our plug-ins work with function windows. Rhino auto-save is closing these windows, something we don’t want. We’d like to have what seems to be normal in Rhino, auto save waiting for the current function to be ended before being executed. Is there a way to trigger this behavior in the Rhino API?

TIA,
Michael


(Dale Fugier) #2

Hi Michael,

I would like to know more about what your plug-in is doing and why you think AutoSave is “closing windows.” How can I repeat what you are seeing? Can you create a simple plug-in example that repeats this?

With that, you can always turn off AutoSave before doing something, and turn it back on when you are finished. For example:

const BOOL bAutoSave = RhinoApp().AppSettings().FileSettings().m_autosave;
if( TRUE == bAutoSave )
{
  // Turn it off...
  CRhinoAppFileSettings settings = RhinoApp().AppSettings().FileSettings();
  settings.m_autosave = FALSE;
  RhinoApp().AppSettings().SetFileSettings( settings );
}

// TODO: Do time consuming task here...

if( TRUE == bAutoSave )
{
  // Turn it back on...
  CRhinoAppFileSettings settings = RhinoApp().AppSettings().FileSettings();
  settings.m_autosave = TRUE;
  RhinoApp().AppSettings().SetFileSettings( settings );
}

#3

Hi Dale,

sorry, spoke to the developer, we are closing our windows on our own when Rhino auto save starts, because otherwise we might run into trouble when writing into the Rhino document during that time.

Nevertheless your code piece is useful, because with that we should be able to avoid the need of closing our windows.

Thanks for your response!

Cheers,
Michael