In C#, how to exit dwg files without having to choose whether to save it?

Hi everyone. I am writing a c# plugin to automatically extract some specific information from a list of dwg files, and I can’t find a way to supress the “do you want to save” dialog.

Someone asked similar questions before, but the link for solution sample file that @Dale kindly offered is 404 page not found now. It would be a great help if anyone knows how to do it. :pray:

Can you point me to that link?

– Dale

@dale Thanks for your reply!!
The 404 page not found link:
https://github.com/mcneel/MOVED-rhinoscript/blob/master/BatchRender.vbs
https://github.com/mcneel/rhinoscript/blob/master/RhinoRender.vbs
https://github.com/dalefugier/SampleCsAutomation
The discussion i saw those links:

Hi @1912351430,

Those samples have been moved to the developer samples repository on GitHub.

https://github.com/mcneel/rhino-developer-samples/blob/6/rhinoscript/BatchRender.vbs

https://github.com/mcneel/rhino-developer-samples/tree/6/rhinocommon/cs/SampleCsAutomation

– Dale

@dale Thanks! The first link seems promising.:heart:

If using RhinoCommon, set this property to false and Rhino won’t prompt you to save.

https://developer.rhino3d.com/api/RhinoCommon/html/P_Rhino_RhinoDoc_Modified.htm

– Dale

@dale I tried doc.Modified = false, but it still asked me to save the dwg file as 3dm(not in a dialog though). I guess it is because it’s a dwg file I am openning not a 3dm file?