Import Display Modes via python


#1

Hi,

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

Thanks
Manuel


#2

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.


(Steve Baer) #3

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


#4

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


#5

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


#6

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.


#7

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

c.


#8

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