Filter family types by material

Hi guys,
I’m a beginner in Dynamo and need your help in list filtering. I’m, trying to filter Family Types by Material (and replace The Material afterwards). Can sameone say me, why my “==” function says that all conditions are false?

Hi @PPsi ,
Welcome to the community!

Change the lacing for == node.

Hi _Vijay,
thank you for the reply! I tried every lacing option, it doesn’t work anyway :frowning:

See if that helps

Material filter.dyn (16.1 KB)

if you show full image of your script will help

Hi @PPsi and welcome, use the node Material.Name to get the names of the materials as strings then compare them.

Thank you, it works with family names. But maybe someone can explain me why it does’nt work with material IDs ?


Filter by Material.dyn (18.2 KB)

Material of a column is a parameter of family type, not of family instance, so my way to list the family types instead of all elements of category “structural columns” was clever, or I understand something wrong? My task is to change Material of columns. I need to change for example “C35/45 Columns” To “C35/45” which also already exist (so i can’t just rename the materials)

@PPsi you are getting the Material Elements and not their IDs, you can use the Element.Id node to get the ID as an integer and make the comparison, as an answer to your specific question, I guess a material applied to an element is an instance of that material, maybe someone else has a more solid explanation to share :slight_smile:

Does this answer your task?

Yes, this strange,

When compared with material it’s not working,

Actually not, but was still helpful.
I’ve reached my goal, but that was surely not the easiest way. The main Problem is, that this is not universal (strings used) and if I had even more materials, it would by very time-consuming.
So i have few additional questions for the next time (and maybe for other users)

  1. Is there any way to do this task without dynamo?
  2. Any idea how could I do I simpler in dynamo? Maybe could I at least translate (map?) the list of materials using a dictionary like this: {“C 40/50 Stützen”:“C40/50”}?

Filter by Material_new.dyn (52.4 KB)

in my opinion,

for Question 1,

maybe some other way using add-ons or pyRevit.

for Question 2,

Yes, you can create a dictionary and some conditions then use them for set parameters.