@5chmidt wrote:
Greetings,
I am attempting to hide multiple objects in multiple details within several layouts of a rhino file.
I have got a test script functions correctly, however I have had to use rs.Command("_HideInDetail").
The problem is, my current method takes a long time to hide large numbers of objects across several layouts and details. I assume there must a way to gain access to the HideInDetail functionality without using the Rhino command line, but I have not been able to locate it in the docs.Any assistance would be extremely helpful, below is my test code complete with command line functions.
Thanksimport rhinoscriptsyntax as rs import Rhino import scriptcontext def HideInDetails(Objs): for layout in scriptcontext.doc.Views.GetPageViews(): #Get all layouts in document scriptcontext.doc.Views.ActiveView = layout #Set layout to active view for detail in layout.GetDetailViews(): #Get all detail in each layout if detail.DetailGeometry.IsProjectionLocked==True: #Test if deatil is locked detail.DetailGeometry.IsProjectionLocked=False #Lock detail so we can edit it detail.CommitChanges() #Unlock the detail layout.SetActiveDetail(detail.Id) #Set detail to active ## Would like to accomplish this in rhino common ## rs.SelectObjects(Objs) #Select Items we dont want to see in detail rs.Command("_HideInDetail") #Hide everything you dont want to see in the detail rs.Command("_SelNone") #Clear selection objs=rs.GetObjects("Select objects to hide in all details") if objs: HideInDetails(objs)
Posts: 7
Participants: 2