I’m working on a script to make projected views, spoiler:
but I have trouble finding out which view the detail is, currently I’ve done it through a hack which introduces some limitations. How can I know if the View’s projection is world top, front, left, bottom, or back?
Any ideas how I can make it work that clicking left of the top view also gives me the left view instead of a tilted top view?
when I try this with a detail view, I can retrieve it’s viewport title trough detail.Viewport.Name, but when I try to set a name through detail.Viewport.Name = “test” it doesn’t work. What am I missing?
Setting the detail name through detail.Name does work.
sample that should work with the 3dm I posted in first post:
import Rhino
import scriptcontext as sc
import rhinoscriptsyntax as rs
detailview = rs.GetObject("select detail for projected view",32768, preselect=True)
d=rs.coercerhinoobject(detailview)
print d.Viewport.Name #prints 'Top'
d.Viewport.Name = "newtitle"
d.Name="detailname"
d.CommitChanges()
@dale is it possible somehow to show the user a preview of the detail view I am trying to create? Right now all I display is a bounding rectangle of it (as shown in the video in the beginning of my post) but this is not very informative.
and it seems to be working only in Rhino 5?
How do I make this work in Rhino 6/7?
edit: found the issue: e.Display.DrawBitmap(self.display_bitmap, 50, 50, System.Drawing.Color.Red)
should be: e.Display.DrawBitmap(self.display_bitmap, 50, 50)
@dale DetailView does not inherit from RhinoView, so there is no CaptureToBitmap() method. Do you have any suggestions how I can capture the content of a detailview?