Struggling with hide element

Hi all,

I have search previous topics but still can get my solution.

Problem 1.
I feed 3 StructuralPlanViews in the string.contains but only one (the last one) appears.

Problem 2.
The node View.HideElements is not working as i tought is should. I feed the sections wich i want to hide in “Element” and the view(s), where these sections are, to “View”.

here is the dyn file Tekening dupliceren.dyn (33.4 KB)

Hope someone could help me out.

Thnks Edwin

You’re trying to hide the actual view element, which won’t work. You want to hide the section graphic element. Unfortunately there’s no good way to get these elements (last time I checked).

Here’s a little trick you can try that usually works:

  • Get the element Id from the section view elements

  • Subtract 1 from the Id (this is usually the Id of the graphical element associated with a view)

  • Get the element from the new Id (Rutabaga has a node Revit.ElementById or you can use python)

    import clr
    clr.AddReference(“RevitNodes”)
    import Revit
    clr.AddReference(‘RevitAPI’)
    from Autodesk.Revit.DB import *
    clr.AddReference(‘RevitServices’)
    import RevitServices
    from RevitServices.Persistence import DocumentManager
    from RevitServices.Transactions import TransactionManager

    doc = DocumentManager.Instance.CurrentDBDocument
    OUT = doc.GetElement(ElementId(IN[0]))

@ nick,

thanks for pointing me in the right direction that the ID from a section on a view is not the same as the ID from the section itself.
I manage to created this solution but i guess it only works with one item as input in the python node (from Kulkul), i hope someone could help me to rewrite this to make it works with a list of items.
I am sadly not familiar with python.

thnks.

Can you show the node previews? What is your input for the python node? You can create a simple for loop to iterate through a list.

Hi Nick,

Here it is.

Python%20node
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *

clr.AddReference(‘RevitServices’)
import RevitServices
from RevitServices.Persistence import DocumentManager

views = UnwrapElement(IN[0])

elements =
doc = DocumentManager.Instance.CurrentDBDocument
cat = doc.Settings.Categories.get_Item(BuiltInCategory.OST_Views)
for view in views:
collector = FilteredElementCollector(doc, view.Id)
elements.append(collector.ToElements())

OUT = elements

thnks

Here are the node previews
At this moment i have only one planview this is because of problem 1 at the top of this topic eventually this must be a list of ‘plans’ (structural and floorplans)

I don’t quite understand the problem here. The collector is already a list so this should work with multiple input views.

You’re absolutely right i quickly simulate multiple input and it works as it should be.

Still problem 1 i don’t understand why after String.Contains only 1 item came out as true.

Oh i see what you’re saying. You’re flattening Element.Name which is removing the list structure for when you mask your sublists. Get rid of the Flatten node and use list levels with your BoolMask.

i am thinking around and around but i just don’t get it what am i doing wrong here.

Oh I was talking about your previous image with the element name.

In this case, try changing String.Contains to searchFor @L2. That will give you a separate sublist for each search term. Then you’ll have to use list level @L2 again for mask on the FilterByBoolMask node.

Thanks Nick for your time and answers i finally got it working.

Just started this part over from the beginning and considering your suggestion @L

Edwin