Import Display Modes via python

Hi,

can I access the option menu feature to import a new display mode via python?

Thanks
Manuel

Hi Manuel, not yet, either via command scripting or python. But it has been asked for frequently and will hopefully be possible in Rhino 6.

c.

@holo is doing this; maybe he can share a sample

thanks, i see there is AddDisplayMode in RhinoCommon but have no clue yet how to use it :blush:

Thanks. @Holo an example how you solve this (using rhino.common) would be very much appreciated.

Hey, I’m glad to give something back :slight_smile:

I could not find a propper way of doing it, so I hacked it…
I ended up rewriting the .ini to add the needed header, and then I used:

rs.Command ("-_OptionsImport "+chr(34)+str(strFolder)+chr(92)+strMode+".ini"+chr(34)+" _AdvDisplay=Yes _Enter" ,False)

You need to assign strFolder and strMode.

1 Like

Thank you Jørgen. That is highly creative, i would have never thought about doing it via OptionsImport :smile:

c.

I am no coder, so I have to be creative… :smile:
Just remember to add the .ini header. The lines of code I added to mine are:
(Replace the xxxxxx)

[Rhino Options]
ExportDate=xxxxxxx
ComputerName=xxxxxxxxx
UserName=xxxxxxxxxxxx
RhinoUuid=xxxxxxxxxxxxxx
RhinoBuildDate=xxxxxxxxxx
RhinoSdkVersion=xxxxxxxxx