Change all Detail view display settings


#1

Hi Guys,

Working on a LARGE file, with many layouts, I wonder is there a way to set all view ports (detail views) to wireframe display without having to go to each layout and manually change it. This takes way to long.

Cheers

D


#2

I worked this one out in python with the help of this forum a while ago. I have another one that lists the options of view style, then applies your selection to all detail views.

import Rhino import scriptcontext as sc

def SetDetailsToWireframe(debug):
# Find the wireframe display mode
display_mode = Rhino.Display.DisplayModeDescription.FindByName(“Wireframe”)
if display_mode:
DebugPrint(display_mode, debug)
# Get all of the document’s page views
page_views = sc.doc.Views.GetPageViews()
if page_views:
# Process each page view
for page_view in page_views:
DebugPrint(page_view, debug)
# Get all of the page view’s details
details = page_view.GetDetailViews()
if details:
# Process each page view detail
for detail in details:
DebugPrint(detail, debug)
# If the detail’s display mode is not wireframe…
if detail.Viewport.DisplayMode.Id != display_mode.Id:
# …set it to wireframe.
detail.Viewport.DisplayMode = display_mode
detail.CommitViewportChanges()
# Redraw the page
page_view.Redraw()

def DebugPrint(object, debug):
if object and debug:
print object

SetDetailsToWireframe(True)


(Dale Fugier) #3

Here is a link to the above:

https://github.com/mcneel/rhino-developer-samples/blob/5/rhinopython/SampleSetDetailsToWireframe.py

– Dale


#4

Whats the easiest way to implement this script and how does one turn the script off? Sorry new to the scripting idea in Rhino.


(Dale Fugier) #5

Hi @DanSummers,

You’ll need to start here:

http://developer.rhino3d.com/guides/rhinopython/

Or perhaps here:

http://developer.rhino3d.com/guides/rhinopython/your-first-python-script-in-rhino-windows/

– Dale


#6

dale,

Thank for the script, works like a charm! :+1: