Replace By Condition not replacing values from list

I am trying to replace values containing “Doors” with “DB” which is not working! Help please. ([https://imgur.com/a/E6mDZWh])

This is basically an “if”-statement… saying "if x = doors then DB else x :slight_smile:

You cannot use “less or equal” to evaluate a string that should be used for values :slight_smile:

You might be able to use the “equal” node instead though…

1 Like

Hello, thanks for the input. i just checked and found its working fine with codeblock but not with my list. :frowning:

Have a look at what kind of object you’re dealing with:

use the “Object.Type” node and connect that to your flatten node :slight_smile:

I am little confused here. Basically what i need to do is, i want to feed a value to a new project parameter depending on what category it is. Its working fine with single category. But when I’m combining more than one categories its not working. Kindly advice.
Below script is for single category. New project parameter is A and DR values are fed to it.
Now i need to feed WN for project parameter A for Windows.
I can run this script multiple times changing its category but it will not be efficient.

i tried flatten node with object.type but its now working

That in itself wouldn’t work :wink: But my suspision is confirmed as to why my first suggestion does not work… You’re trying to compare “Revit.Elements.Category” elements to “strings” (called “doors”) that will not work, you could use “Object.ToString” but you might not be able to subsequently reuse the name “door”/“db” as it is now string and not an Revit.Elements.Category element…

ok so one quick question:
when i am replacing with replaceitematindex its working fine.


And is there a way so i can create a list with “Doors” replaced by “DB”?

Its working with the node string from object.
Thank you so much!!