Still prompted to save after doc modified flag set to false

My document is still “edited” after I set the doc.Modified flag to false.

Version 8 (8.5.24072.13002, 2024-03-12)
Rhino Mac

import Rhino

doc = Rhino.RhinoDoc.ActiveDoc
doc.Modified = False

Hey @Johan_Lund_Pedersen,

In my brief testing, I’m not able to repeat this here.

Are you running any 3rd party plug-ins?

– Dale

Hi @dale

Thank you for getting back to me. I don’t think I have any plugins on the machine. My system info is below.

Am I right to assume that the code below should close Rhino without prompting to save?

Here is how it looks on my machine.

Also, the line Rhino.RhinoApp.Exit() does not appear to do anything. I need to use RunScript to get the “save as” response.

import Rhino

doc = Rhino.RhinoDoc.ActiveDoc

# Make a change to the doc
st = doc.Strings
st.SetString("change","doc")

doc.Modified = False
Rhino.RhinoApp.Exit() # This line does not appear to do anything.
Rhino.RhinoApp.RunScript("Exit", False) # This line promotes the save as.

SystemInfo:
Rhino 8 SR5 2024-3-12 (Rhino 8, 8.5.24072.13002, Git hash:master @ e3530849b75f00b2b977766a567ae29b055837e9)
License type: Educational, build 2024-03-12
License details: Cloud Zoo

Apple macOS Version 14.4.1 (Build 23E224) (Physical RAM: 8GB)
Mac Model Identifier: iMac21,1
Language: en-DK (MacOS default)
.NET 7.0.0

Metal GPU Family Apple 7
Metal GPU Family Common 3
Metal GPU Family Mac 2
Graphics processors
Apple M1
iMac (2240 x 1260 @ 60.00Hz)

USB devices
Apple Inc.: Apple MagSafe Charger
Apple Inc.: Apple Watch Magnetic Charging Cable
USB: SanDisk 3.2Gen1
USB: SanDisk 3.2Gen1

Bluetooth devices
None

Third party kernel extensions
None

Third party plugins
/usr/lib/swift/libswiftCore.dylib
/usr/lib/swift/libswiftCoreFoundation.dylib
/usr/lib/swift/libswiftCoreGraphics.dylib
/usr/lib/swift/libswiftCoreImage.dylib
/usr/lib/swift/libswiftDarwin.dylib
/usr/lib/swift/libswiftDispatch.dylib
/usr/lib/swift/libswiftIOKit.dylib
/usr/lib/swift/libswiftMetal.dylib
/usr/lib/swift/libswiftOSLog.dylib
/usr/lib/swift/libswiftObjectiveC.dylib
/usr/lib/swift/libswiftQuartzCore.dylib
/usr/lib/swift/libswiftUniformTypeIdentifiers.dylib
/usr/lib/swift/libswiftXPC.dylib
/usr/lib/swift/libswift_Concurrency.dylib
/usr/lib/swift/libswiftos.dylib
/usr/lib/swift/libswiftsimd.dylib
/usr/lib/swift/libswift_StringProcessing.dylib
/usr/lib/swift/libswift_RegexParser.dylib
/usr/lib/swift/libswiftCryptoTokenKit.dylib
/usr/lib/usd/libusd_ms.dylib
/usr/lib/swift/libswiftCoreAudio.dylib
/usr/lib/swift/libswiftCoreLocation.dylib
/usr/lib/swift/libswiftCoreMedia.dylib
/usr/lib/swift/libswiftCompression.dylib
/usr/lib/swift/libswiftCoreMIDI.dylib
/usr/lib/swift/libswiftAVFoundation.dylib
/usr/lib/swift/libswiftCoreML.dylib
/usr/lib/swift/libswiftFileProvider.dylib
/usr/lib/swift/libswiftIntents.dylib
/usr/lib/swift/libswiftAccelerate.dylib
/usr/lib/swift/libswiftGLKit.dylib
/usr/lib/swift/libswiftGameplayKit.dylib
/usr/lib/swift/libswiftMetalKit.dylib
/usr/lib/swift/libswiftModelIO.dylib
/usr/lib/swift/libswiftSceneKit.dylib
/usr/lib/swift/libswiftSpriteKit.dylib
/usr/lib/swift/libswiftVision.dylib
/usr/lib/swift/libswiftRegexBuilder.dylib
/usr/lib/swift/libswiftDemangle.dylib
/usr/lib/swift/libswiftShazamKit.dylib
/usr/lib/swift/libswiftObservation.dylib
/usr/lib/swift/libswiftVideoToolbox.dylib
/usr/lib/swift/libswiftWebKit.dylib
/usr/lib/swift/libswiftNaturalLanguage.dylib
/usr/lib/swift/libswiftSystem.dylib
/usr/lib/swift/libswiftMapKit.dylib
/usr/lib/log/liblog_network.dylib
/Users/johanpedersen/.rhinocode/py39-rh8/libpython3.9.dylib
/Users/johanpedersen/.rhinocode/py39-rh8/lib/python3.9/lib-dynload/_heapq.cpython-39-darwin.so

Rhino plugins that do not ship with Rhino

Rhino plugins that ship with Rhino
/Applications/Rhino 8.app/Contents/Frameworks/RhMaterialEditor.framework “Renderer Development Kit” 8.5.24072.1002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/Commands.rhp “Commands” 8.5.24072.13002
/Applications/Rhino 8.app/Contents/PlugIns/NamedSnapshots.rhp “Snapshots” 8.5.24072.1002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/RhinoCodePlugin.rhp “RhinoCodePlugin” 8.5.24072.13002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/RDK_EtoUI.rhp “RDK_EtoUI” 8.5.24072.13002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/MeshCommands.rhp “MeshCommands” 8.5.24072.13002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/RhinoRenderCycles.rhp “Rhino Render” 8.5.24072.13002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/RhinoCycles.rhp “RhinoCycles” 8.5.24072.13002
/Applications/Rhino 8.app/Contents/PlugIns/SectionTools.rhp “SectionTools” 8.5.24072.1002
/Applications/Rhino 8.app/Contents/PlugIns/Displacement.rhp “Displacement” 8.5.24072.1002
/Applications/Rhino 8.app/Contents/PlugIns/PanelingTools.rhp “PanelingTools” 8.5.24072.1002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/RhinoDLR_Python.rhp “IronPython” 8.5.24072.13002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/GrasshopperPlugin.rhp “Grasshopper” 8.5.24072.13002

Hi @Johan_Lund_Pedersen,

Sorry for the delay in replying.

Setting the RhinoDoc.Modified flag in Rhino for Mac currently does nothing. This is because, unlike Windows, Mac document changes are managed by the operating system. For now, the best you can do is look to see if the document is modified and take whatever action you need.

Not sure why this isn’t document…

– Dale

Hi Dan

Thank you for your relay.

Am I right to assume that my options then are:

  1. save to a “temp” file and “-exit”
  2. do everything in a headless doc and then dispose() of the doc

I think that it would be nice if there was a way to exit without saving from the command line.
Something like “-Exit ExitWithoutSaveing”