Why doesnt my 'equals' work

Hi all, am i doing something silly here?

Im just trying to find the items that are ‘Air Terminals’. They are all air terminals, so why do i get ‘false’?

Thanks for help

Since you are comparing string values, use List.Contains instead of equal node.

Thank you for the prompt reply, but it doesnt like that either

Try using String.Contains

Dynamo just doesnt like me :frowning:

It doesnt like ==, String.contains or list.equals

@johnbim ,

intresting with designscript it works… :face_with_monocle:

import clr
import sys 

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

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

clr.AddReference('System')
from System.Collections.Generic import List

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

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

# 1️⃣referenced docs

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument


# 2️⃣ collector

collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_PipeCurves)
all_pipes = collector.WhereElementIsNotElementType().ToElements()
# 3️⃣ Categories

cat = [i.Category.Name for i in all_pipes]


OUT = all_pipes, cat
#✅End

KR

Andreas

What is the error you are getting with the string contains node?

Ice changed the structure of my whole script to avoid this problem. Thanks guys for the help anyway.

Hello
at the output of your node those are not categories (Categories yes but not the name of this category)
Plug in a type.Object you will see you will not have string

hook a code block with x.Name
and you should get results
edit:

Sincerely
christian.stan

6 Likes