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?
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.
#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]
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).
Hi Daan, sounds like you need a variation of this node to work for linked docs:
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.
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?
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.
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
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.