Grasshopper

algorithmic modeling for Rhino

Hi all,

I was wondering if it was possible to change the transparency of the ghosted view via script/macro. The way you can do through rhino is using the menu DocumentProperties / view / display mode / ghosted / transparency. Do you reckon there is any way to do it while working on a python script with a rhino command?

Thanks in advance

Vincenzo

Views: 252

Reply to This

Replies to This Discussion

While there's some SDK access to display mode properties via Rhino.Display.DisplayModeDescription, the ghosted transparency display does not appear to be something you can modify. I could be wrong though - you might have better luck asking around the discourse forum since this isn't strictly Rhino-related. 

Hi Vincenzo,

As Andrew mentions transparency in display modes  doesn't seem something you can modify at least directly. I had a quick look at the SDK but I couldn't find an easy solution. Discourse is definitely the place to look.

I modified an old C# script I was using to change the display width of curves in my viewport. Please refer to this for at least the logic of trying something similar with other attributes.

Best,

M.

import Rhino.Display as rd

# creat some empty arrays
display_modes = []
display_modes_names = []
#retrieve the list of Display modes on the document
display_modes = rd.DisplayModeDescription.GetDisplayModes()
#find out their names
for i in range(len(display_modes)):
display_modes_names.append(display_modes[i].EnglishName)

#pick the display style that you want
for j in range(len(display_modes)):
if display_modes_names[j] == y:
disp_index = j
else:
continue
selected_mode = display_modes[disp_index]

if x == True:
selected_mode.DisplayAttributes.CurveThickness = z
rd.DisplayModeDescription.UpdateDisplayMode(selected_mode)
print("Changed the display option settings for visual style : " + y)
else:
selected_mode.DisplayAttributes.CurveThickness = 0
rd.DisplayModeDescription.UpdateDisplayMode(selected_mode)
print(y+ " Display style reset to default settings")

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2017   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service