What is the equivalent of "Hide Objects in Detail" or "Show Objects in Detail" in RhinoCommon C#

I have done some research and I cannot find the function to “Hide Objects in Detail” or “Show Objects in detail”

For example, I have a few geometries in Rhino, I have square, triangle and circle.

I want to have a Layout of each geometry.

So I create the layout for “Square” first, then create a view, then in the view, I have to hide triangle and circle.

At the moment, I can create the layout, but I cannot seem to find the function to “Hide Objects in Detail” …

1 Like

Hi Toby,

I don’t see a way of this yet. But you can always script these commands.

I’ve added a wish list item:

http://mcneel.myjetbrains.com/youtrack/issue/RH-34998

– Dale

Hello,
I know this is an old post but I was wondering if this had been implemented yet?

I have been doing this as a workaround but its rather slow and clunky and I would love to replace it.

            string cmd = "-_HideInDetail ";
            foreach (Guid id in ids)
            {
                cmd += "_SelID ";
                cmd += id.ToString() + " ";
            }
            cmd += "_Enter ";
            RhinoApp.RunScript(cmd, false);

I see @stevebaer referenced in a pull request for January of this year. Let me know when it is live in version 6.
Thanks,

Hi @5chmidt,

Yep, in Rhino 6 use ObjectAttributes.AddHideInDetailOverride.

– Dale

1 Like

Thanks, I’ll give that method a try!

Hi Dale,

Are there any example that use AddHideInDetailOverride?
It does not seem to be working for me and it does not have any errors.
When I step through the code, I am calling the AddHideInDetailOverride, but the objects are still shown in the detail view.

if (docLayer.IsVisible) {
    // hide layer objects in detail
    var layerObjects = _doc.Objects.FindByLayer(docLayer);
    foreach (var layerObject in layerObjects) {
        ObjRef layerObjRef = new ObjRef(layerObject);
        RhinoObject obj = layerObjRef.Object();
        obj.Attributes.AddHideInDetailOverride(detail.Id);
    }
}

I guess I should add that I am looping through multiple details and only showing objects that are on a particular layer or its parent / child layers.

The code is called on all layers that are not parents, children or the selected layer for each detail.

I don’t know if that may have some affect on the result. It is hard to see where the AddHideInDetailOverride attributes are stored for each object.

Hi @jake1,

Here is a full-featured example:

SampleCsHideInDetail.cs

– Dale

2 Likes

That helps a ton! Thank you.