Hide Sections if on Specific Sheet

I am trying to hide all section cuts on floor plans that are placed on a certain sheet. Basically I have a set of sheets for an alternate in the project, but the section cuts are showing up in the main floor plan sheets. So I want to grab all sections in the project, and if the section cut is placed on an “ALTERNATE” sheet, then hide that section in the floor plan. I have filtered all sheets to select only the “ALTERNATE” sheets. And grabbed the Sheet Number for each section, but now I’m stuck and don’t know how to compare the two, to be able to grab the element ID to hide in the views. Does anyone have any advice?

You should test the two Sheet Number nodes against each other with an “==” node. Run this through a List.FilterByBoolMask node for the sections to then “hide” in view.

Ah, thanks. That got it.
But now I’m running into a different issue. I have grabbed the section cuts in my project and have filtered them to the ones on the sheets I want. But when I try to View.HideElements, I am getting an error. I then realized that the element ID of the section in Dynamo is not reading the same as the element ID of the element when I select the object in Revit. They appear to be 1 number off. Do you have any idea what is causing this? This may need a whole other post for this question.Capture

1 Like

Can you show the graph as you have it now? Are you getting an “GetItemAtIndex” anywhere that may be a number off?

Here is what I have now:

1 Like

Try to Flatten the Sheet.View output, or use Level on the View.HideElements node. You have different list structures here and that is probably causing your issue. You may also want to remove the “Empty List” from the Sheet.View to eliminate other potential errors. You can do that with a List.IsEmpty and a FilterByBoolMask.