Input or Input

Hello

I was wandering if there was a way to let the user choose by either selecting elements or all elements of a category while using dynamo player.
which means if he picks one the other input will not go through.

image

appreciate any help

I would use a scopeif node, so that if Select model Element is empty, the wall category gets fed into the next node.

Just now realised that if you do this, it will result in an error when its left empty|:

2 Likes

If you want to go the Python way:

import clr

clr.AddReference("RevitAPIUI")
from  Autodesk.Revit.UI import *

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

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

# Place your code below this line
if IN[0]:
	output = uidoc.Selection.PickElementsByRectangle()
else:
	output = FilteredElementCollector(doc).OfCategoryId(UnwrapElement(IN[1]).Id).WhereElementIsNotElementType().ToElements()
# Assign your output to the OUT variable.
OUT = output
3 Likes