Get building elements that contain a specific material

Hi,
Please any node in Dynamo packages is able to provide the elements that contain a specific material. For example if the material in question is concrete the node will be able to provide all the elements that contain this material as output. I’ve tried most of Dynamo nodes related to material issues but couldn’t find a solution.
Thanks you

3 Likes

I haven’t seen one, but you could certainly build a script that does this.

Element.GetParameterValueByName node to request the “material” parameter value should do the trick. You’ll need some additional nodes to pull system family materials (wall/ceiling/etc), and multi-material families could be an issue if you don’t have a good parameter naming standard.

Run the results of that into a == node to set a boolean and you should have your list.

@segatakieddine

If you can’t find a solution in Dynamo, you can make an ODBC dump to excel.
That will give you a materials table with the Id’s of the families where this concrete can be found.
If you make a pivot table you can make this data readable.

Marcel

2 Likes

Only concern with @Marcel_Rijsmus’ solution is that you’d need to run the export and then would have to import the excel into Dynamo in order to do anything with the results.

Once you have the elements what would you like to do with them?

1 Like

You could try the following steps:

  1. Collect all model elements and flatten
  2. Run them through Element.Materials from Clockwork (this should also catch elements that do not have specific material parameters assigned to all of the geometry and elements that have their material set to “By Category”)
  3. Filter out all elements that have no material assigned (“hasMaterial” output)
  4. In the list of remaining elements find those that have the material in question assigned to them

On large models, this would be quite a big operation, going from elements to materials back to elements. Unfortunately, I don’t know of a way to go directly from materials to elements.

3 Likes

@jacob.small
let’s say our project consists of two floors and two walls…all these elements contain at least one concrete material element… now I filtered the concrete material element from the project elements(Walls/floors) but still need to associate the concrete material element again with it’s hosted building element (Wall/floor)… My aim is to get a list of all concrete material in the project with its associated building elements
PS: there is a node in Clockworks package called “Element Material” that dose exactly the opposite of what i’m looking for you give it the element as an input and it gives you the material as an output.
thank you

@Andreas_Dieckmann

A question gnawing at my soul:
Would this method work if the materials are set to subcategories in object styles?

Marcel

That shouldn’t make a difference, I think. As far as I know, the API command basically looks at every piece of geometry in an element and tries to deteremine the assigned material. The bigger issue is that material takeoffs are not permitted for every category (e.g. ramps and railings, if I remember correctly).

There are several ways to get the materials from elements, that’s why it’s difficult to create one node to work for all cases. Read more here: https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2015/ENU/Revit-API/files/GUID-FD067FA5-623D-474B-98FB-686C096F0165-htm.html

1 Like

I tried to get all the elements on Level 1 with a material whose class = concrete. I successfully got all the materials in that class, but I can’t figure out how to get all the elements in that class. When I use a Bool mask I get an error: Dereferencing a non-pointer.
How do I get all the elements with a specific material, like concrete?

You could do the following: get indices of “concrete” in “material.material class” list. Then get elements at indices from “All elements at level” selection list.
I am not sure how bool mask works.
This may not be the shortest solution and requires bakery, archilab and clockwork packages installed.
If the use case is visibility in a view (temporarily or permanent), making a filter is much easier.

Hi Adi,
Thanks for your reply! I am looking for all elements on level1 with material of concrete, so I can find the volume of all of said elements. I have figured out the volume part but am still struggling with getting just the elements that are concrete.

I am not sure I understand exactly what you mean by getting the indices… I am new to Dynamo. My understanding is that I find all the times that the material class is concrete in the project. Then I’d find all the elements at a level. I still don’t understand how to make the two concepts talk to each other. I get a string of materials that have the material of concrete. I can get a list of all elements on a level. But how do I filter the elements of that level by the string of materials that are concrete? Is there an easier way to grab all elements with the same material?

Hi all,

I got an easy way from YouTube below
Dynamo - Get Model Element Material and Name

Hope this is helpful

1 Like

just for future reference, in case the yt video will be offiline: