Good afternoon. To optimize the work of our Department, based on the work of this forum, I created my own script, I would like to share it and ask a few questions.
The task was to check for filling in the values of the parameters, but in the process it was extended to the calculation of “Volumes” by the value of the parameter and display a list of ID to facilitate the search for elements.
For the script to work, you need to open the prepared 3D view, specify the desired Parameter and its value. If the value is not filled, values with a space will be presented. The script works in the environment “Dynamo” 1.3 and above.
The results of the script will be presented in 3D, where the red elements will be highlighted with the specified value of the parameter. In the “Dynamo” in the group of ‘result’ will indicate the Amount of items and the list ID (selected ID).
My question:
Node “Wath” (ID selected) allows you to quickly find items by clicking on an ID, however I would like to highlight them by clicking the mouse. Is there a solution to this problem?
Now, as a temporary solution, I use a third-party Node and bring the parameter to it in the form of a list index, but this is extremely inconvenient.
What can I use to output the group “result” in Revit and does it make sense to do it?
I thank everyone involved for their invaluable help in solving the problems and especially Mostafa_El_Ayoubi, Dimitar_Venkov , Konrad_K_Sobon, and kennyb6 whose achievements I used in my work.
Перевести вGoogleBingI would be grateful for comments on my script.I would be grateful for comments on my script.
Filter_Parametr_Value.dyn (10.1 KB)

# Andbary Shtrabag Moscow
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
import Autodesk
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc=DocumentManager.Instance.CurrentDBDocument
clr.AddReference("DSCoreNodes")
from DSCore import *
sss=IN[0]
sss1=IN[1]
sss2="Volume" #Считаем Объем
red=255 #Красный
grey=150 #Серый
Visible1=IN[2]#Скрыть или оставить не имеющие значение параметра
Visible2=IN[3]#Уровень прозрачности
as1 = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Floors).WhereElementIsNotElementType().ToElements(), FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).WhereElementIsNotElementType().ToElements(), FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_GenericModel).WhereElementIsNotElementType().ToElements(), FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_StructuralFoundation).WhereElementIsNotElementType().ToElements(), FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_EdgeSlab).WhereElementIsNotElementType().ToElements(), FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_StructuralColumns).WhereElementIsNotElementType().ToElements(), FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_StructuralFraming).WhereElementIsNotElementType().ToElements(), FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Stairs).WhereElementIsNotElementType().ToElements()
as2 = List.Flatten(as1,2)
lk = []
lk1 = []
for k in as2:
r = k.LookupParameter(sss).AsString()
if sss1=="" or sss1=='' or sss1==" " or sss1==None:
if r==None or r=="" or r=='':
lk.append(k)
else:
lk1.append(k)
else:
if r==sss1:
lk.append(k)
else:
lk1.append(k)
lk3=[]
for o in lk:
try:
r = o.LookupParameter(sss2).AsDouble()/35.31466672
except:
r = 0
lk3.append(r)
color = Autodesk.Revit.DB.Color(red,0,0)
color0 = Autodesk.Revit.DB.Color(grey,grey,grey)
output = []
ogs = OverrideGraphicSettings()
ogs.SetProjectionLineColor(color)
ogs.SetProjectionFillColor(color)
ogs1 = OverrideGraphicSettings()
ogs1.SetProjectionFillColor(color0)
ogs1.SetCutFillColor(color0)
ogs1.SetProjectionLineColor(color0)
ogs1.SetCutFillColor(color0)
ogs1.SetSurfaceTransparency(Visible2)
ogs1.SetProjectionFillPatternVisible(Visible1)
TransactionManager.Instance.EnsureInTransaction(doc)
for i in lk:
output.append(doc.ActiveView.SetElementOverrides(i.Id, ogs))
for j in lk1:
output.append(doc.ActiveView.SetElementOverrides(j.Id, ogs1))
TransactionManager.Instance.TransactionTaskDone()
OUT = lk, sum((lk3))
#1