This sounds familiar. Perhaps this has been requested before ?
Check the issue tracker.
No, and I seriously doubt the SketchUp Team would ever implement something like this.
Ultimate control of (whether or not) to close the model and / or the application is a user feature.
Ie, … if the model has been modified then calling
Sketchup.quit can still be cancelled by the user via the save dialog.
I can think of nothing that would anger users more than the application not doing what they tell it to do. (An extension that does something like this would IMO not be accepted for EW posting. It also would get a bad community reputation and be “in the doghouse” as an extension to avoid.)
Implementing a hack like causing some error to occur is likely to corrupt the model or the SketchUp user settings (that are written during error-free application close cycle.)
Note that some API methods like
Sketchup::Model#close were implemented for batch processing of folders of model files. (This predated the C API and it’s various wrappings in other programming languages which may be a better fit now for such batch work.)
If you explain what you wish to achieve, then perhaps some other members know of other workflows that may work.