Filtering Link Model Wall Types

Hello everyone,

I try to filter wall types from link model and then filter those wall types to specific types and then select all instances of those types. I tried with it but with no success. is there anybody can help?

Thank you guys,

Special Walls.dyn (45.6 KB)

Hi @Simo,

With All Elements From Linked Model, you already have your list of walls elements.
You can filter that list with the Type name to get the specific instances you want.

Thanks for responding,
The problem is, I couldnā€™t get all instances of the filtered wall types.

I already give you a simple answer.

You can also use a Python script if you want something more elaborate.
Use an altered version of Springs.ElementType.Instances.

#From Dimitar Venkov`
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = IN[1]

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)

from System.Collections.Generic import List

def tolist(x):
	if hasattr(x,'__iter__'): return x
	else : return [x]

types = UnwrapElement(tolist(IN[0]) )
catNames = set()
for t in types:
	c1 = t.Category
	if c1 is not None:
		catNames.add(c1.Name)

catId = List[ElementId]()
allCats = doc.Settings.Categories
for cn in catNames:
	if allCats.Contains(cn):
		catId.Add(allCats[cn].Id)

type_storage = dict()
fec = FilteredElementCollector(doc).WhereElementIsNotElementType()
if catId:
	fec = fec.WherePasses(ElementMulticategoryFilter(catId) )

for e in fec:
	id1 = e.GetTypeId().IntegerValue
	if id1 in type_storage:
		type_storage[id1].append(e.ToDSType(True) )
	else:
		type_storage[id1] = [e.ToDSType(True)]

OUT = [type_storage.get(t.Id.IntegerValue, None) for t in types]

I did try that, but that applies to all types not after they are filtered down.

you can test it

Thanks,

Special Walls.dyn (47.8 KB)

The first response by @Alban_de_Chasteigner will work for you, but you may need to make some modifications to work with a list of types.

  1. Create a list of the type names youā€™re after instead of the single string ā€œWalls_23ā€.
  2. Change the lacing on the == node to cross product,
  3. Add a List.Contains node searching for true (again with longest lacing).

For many walls types, itā€™s almost the same thing.

Thank you guys so much for your valuable contribution. It eventually works.

He Guys, Iā€™d like to reply on this post with a challange that is to difficult for me.

I have a Project with a lot of linked files, in which I would like to select Wall etc. based on a parameter value. For Instance:

Select all Walls in Dynamo which contains a certain value in de Parameter ā€˜Commentsā€™.

Iā€™ve tried to crack this one but nothings seems to work. You can use the method of selecting all the walls from the linked files and then filter it down, but that takes 1 hour each time I run the script (Lots of Walls & Linked files up to 3Gb).

Hope someone can helpā€¦

Hi Daan, sounds like you need a variation of this node to work for linked docs:
image
Sadly things work a little different when dealing with linked docs, so it kind of depends on what kind of parameter you want to search (shared parameter or Revit internal). Let me know and Iā€™ll give it a try.

He Taco,

Usually it is an Instant Shared parameter, but somethimes it is also Comments, of a Type parameter instead of Instance. Dealing with a lot of variables hereā€¦

You think you can make that work? and would it be faster than the collect elements and filter method? I sure think so myself. Youā€™re a champ if you can get this one to work!

just wonder what the end use of these filtered elements of linked model? you cannot select it in host model via element ID, you cannot VG override in view via element or filter.
i managed to get specific elements of linked model using Dynamo and Python but i cannot do anything w/ those elements (ID) in host model, so again whatā€™s next?

Maybe reading element parameters for pushing to another value in your current model?

1 Like

Hi Everyone. I was trying to copy and paste to my model all the type walls from a linked model, and I found this topic.
Iā€™m not sure how to filter these walls by type. Can someone help me? I tried to follow the process I read here, but it gave me an empty list if I put the type name on my wall.

Thanks foe any help you can provide!

Hi @lglielmi and welcome hereā€¦this post here is bit old and already have a solution, so best in the future just create a new postā€¦but you could try with element.name instead string from object. in you exampleā€¦thanks

1 Like

Thanks for the welcome, I really astonished at how much is hard find components in Revit. Every time (Iā€™m usually working in Gh), Iā€™m always shocked.

It worked; for the boolean rule, I use just Python it works pretty well.