Create or import DisplayModes in .Net


I’m would like add or import a Display Mode (C#) but didn’t find any documentation I only found how to set a display mode to an object, or change display mode’s properties by code.

The point is to have a new display mode, shown with the other Display modes (Wired, Shaded, Rendered…)

So I know I’m able to create it by Options --> View --> Display Modes, but is there a way to create a new Display Mode by code?, or create a ini file and place it in a folder where Rhino look for it automatically at load time? (without go to “Options --> View --> Display Modes --> Import”)

Thanks and best regards.

Here is an example of how to set an object’s display mode:

You can add your own display modes using Rhino.Display.DisplayModeDescription.AddDisplayMode.

Importing display modes does not look possible, even by scripting the Options command.

The example of setting an objects display mode is very helpful
Do you have an example of how to add a new display mode?

I would expect Rhino.Display.DisplayModeDescription.AddDisplayMode would do the trick. But I don’t see how to create a new Rhino.Display.DisplayModeDescription, or copying an existing one. @stevebaer, any ideas?

Doesn’t look like there is currently a good technique for this. Probably need to run a script to create the display mode.

Hi Dale I currently have several custom display modes I’d like to distribute in our next Rhino/Gh deployment. Would I be able to use Rhino.Display.DisplayModeDescription.AddDisplayMode within a login script to reference the server location of the *ini files and have them imported automatically for the user?

Thank you for your time!

1 Like

Hi Brian,

I wish this was easier. But the display mode export/import feature didn’t have your application in mind.

Rhino’s display mode settings are stored in the Windows Registry. Specifically, you use 32-bit Rhino 5, you can find them here:

HKEY_CURRENT_USER\Software\McNeel\Rhinoceros\5.0\Scheme: Default\Options\DisplayAttributesManager

If you use 64-bit Rhino 5, you can find them here:

HKEY_CURRENT_USER\Software\McNeel\Rhinoceros\5.0x64\Scheme: Default\Options\DisplayAttributesManager

If I were an administrator who wanted to push these out to end users, I would export one of these keys using REGEDIT.EXE. The one you will need depends on what bitness of Rhino you and your clients use.

Once you have a .REG file, produced by REGEDIT.EXE, you can merge this into another system’s Registry during the login process. I’m going to let you research this because I am sure there are several ways of doing this, with the easiest one being to run REGEDIT.EXE with command line parameters.

Keep in mind that some display modes have references to image files (for background, etc.). So, you will want to make sure the path found in the .REG file matches what the end users will have. Note, .REG files are just text files, so you can view with Notepad if needed.

Hope this helps…

2 posts were split to a new topic: Creating DisplayModes in .Net

hi @dale I got notification this was split to new topic re my last question, but when i try go to the topic i get this?

Did you see this thread?

Hi Christopher - that page seems to load fine here, even when I’m not logged in: