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.
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.
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.
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?
You could try the following steps:
- Collect all model elements and flatten
- 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”)
- Filter out all elements that have no material assigned (“hasMaterial” output)
- 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.
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.
A question gnawing at my soul:
Would this method work if the materials are set to subcategories in object styles?
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