An imported Display Mode will disappear after a SaveAs


I am using Rhino 7.34 and trying to use the DisplayModesDescription.ImportFromFile method to load a custom display mode .ini file in c#. The method seems to load the .ini and is visible in the UI after being run. The issue is that if the Rhino document is saved with a new name, the Display mode disappears. If a viewport is using the imported Display Mode, it will revert to a wireframe view during/after the save. Below is an example python code using the method and an example .ini file that was created as a new mode in the Rhino UI. The newly imported Display Mode persists if the file is saved with the same name or if Rhino is closed without saving. Could this be a bug? Is there a way to programmatically write the display mode information to a users machine?

import Rhino
import rhinoscriptsyntax as rs
file = rs.OpenFileName()
if file:
id = Rhino.Display.DisplayModeDescription.ImportFromFile(file)
print id

New Mode2.ini (13.9 KB)