hello, is there a node, or a way to retrieve the elements that are in a particular selection set in revit? Like the opposite of this node. this one writes to, but I want a reads from node… any ideas?
Thanks!
Here is a similar script I wrote a while ago. It currently only works for a single selection set, but it can be easily adapted to account for a list of selection sets.
thanks so much cgartland, but this script that you wrote does not seem to work in dynamo 1.3.4. Is it supposed to?
The .dyn was authored in Dynamo 2.x, so it can’t be opened in Dynamo 1.x. However, you can replicate it in your version of Dynamo by referencing the screenshot and the code pasted below it.
IN[0] connect a string with the name of the selection set, use this python code:
# Import the required libraries
import clr
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import FilteredElementCollector, SelectionFilterElement
# Import RevitServices
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
# Get the current Revit document
doc = DocumentManager.Instance.CurrentDBDocument
OUT = [doc.GetElement(id) for id in next((filter_elem.GetElementIds() for filter_elem in FilteredElementCollector(doc).OfClass(SelectionFilterElement).ToElements() if filter_elem.Name == IN[0]), [])]


