Method to hide objects in Model views, while still visible in layouts?

Hi there!

I have a rhino model with a lot of TextDots. I want these textdots to be visible in a single layout “Detail View”, but not in the model viewport.

some context: The purpose is to create multiple layouts, each of which shows a different set of textdots as an infographic. If each set of TextDots is visible in model space, the view gets clogged and very difficult to select or navigate the correct objects.

Does anyone have a suggestion?


I don’t think that’s possible.
Layers and objects can have their display blocked in Layout Details (HideInDetail), but I think the layer has to be On in the model.

Maybe one of the Bigger Brains has an idea.

It’s doable through ObjectAttributes.ViewportId I think.

Ah. This is a Scripting question.
It’s in the wrong category.
I’ll move it.

Hi @gankeyu,

That was exactly what I was looking for, thanks!

import rhinoscriptsyntax as rs
import scriptcontext as sc

def main():
    # prompt select obj and detail view     
    obj_guid = rs.GetObject("select obj", preselect=True)
    detail_guid = rs.GetObject("Select detail view", filter=32768, preselect=True)
    if not detail_guid or not obj_guid:
        print 'abort'
    # update object attributes with new properties
    rh_obj = rs.coercerhinoobject(obj_guid)
    new_attr = rh_obj.Attributes.Duplicate()
    detail = rs.coercerhinoobject(detail_guid)
    new_attr.ViewportId = detail.Id
    sc.doc.Objects.ModifyAttributes(rh_obj.Id, new_attr, False)
    print "Rhino obj '%s' is now only visible from detail '%s'" % (obj_guid, detail.Id)