Select category from link in active view

Hi,
I’m looking for the node Elements.ByCategoryandView working with links. Does it exists or is there a work around?

Is it Get View Dependent Elements from Linked Documents?

hi,

there might be a better work around, but you can use Archi Lab and Steamnodes packages to get element from linked documents.
i think this could work for what you are looking for

1 Like

No this doesn’t work. I am trying to get views out of the linked model and select models in that view. Like select elements in active view, but with links and categories.

Hi,

maybe like this?

The collector is from spring nodes

Johannes

No, I’m trying select view from linked model and also the elements inside that view. It should be working like Elements.ByCategoryAndView, but with links.

try this :

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*
import System
from System.Collections.Generic import*

linkdoc = IN[0]
category = IN[1]
views = IN[2]
result = []
filter = ElementCategoryFilter(System.Enum.ToObject(BuiltInCategory,category.Id))
ids = [v.Id for v in views]
idlist = [ElementId(i) for i in ids]
for i in idlist:
	result.append(FilteredElementCollector(linkdoc,i).WherePasses(filter).WhereElementIsNotElementType().ToElements())
OUT = result

all non OOTB nodes are from Archi lab

6 Likes

This solved my problem entirely. Thank you very much.

1 Like