How to get material layer of walls

I want to get a materials layer each walls. However, I try to use “Element.GetMaterials” but this show it incorrect (in wall have a 3 layer). Then, I try to use “FamilyType.CompoundSturctureLayer”, a number of layer is correct but I can’t use “Material.StructureParameters” in after.

It appears that you may have identified a bug, but I’m not sure if it’s with Dynamo or the clockwork node you’re utilizing. @Andreas_Dieckmann not sure if you’re aware of this or not. My test was on Revit 2017 with Dynamo 1.3.2.

As you can see the results of the FamilyType.CompoundStructureLayers was an “Revit.Elements.UnknownElement” when it should be “Revit.Elements.Material” for the Material.StructuralParameters node to work. Attempting to reselect by ID returned the same results.

@apikeairt, you can either use the re-selection method I showed in your workspace, or you could create a new custom node based on the clockwork node to do this yourself.

2 Likes

@jacob.small Thanks for letting me know. I don’t think there’s anything I can do about it - it looks like a bug in Dynamo’s auto-marshalling when passing Revit materials from a Python node back to Dynamo. I’ll file it nonetheless and take a look when time permits.

Yeah after finishing another few items on my plate I dug into this further while debating what to have for dinner. There is already a GitHub issue for it so I’m guessing it will be fixed in a future release.
Material Nodes bug · Issue #1581 · DynamoDS/DynamoRevit · GitHub.

1 Like

Thank so much, I can do it already.

hi @jacob.small, I’ve tried your solutions, thanks for your work. I just have another question: I’m trying te get the “keynote” parameter from a material, but with the Material.StructuralParameters, I don’t get it. Do you know if I could look for it from another node?

Thanks in advance!

Get the material element and then get its parameters with an element.parameter node.

If that doesn’t work, please start a new topic and post your current graph as a DYN and a detailed view of what you’ve tried that is failing, as this one is a bit old and already has a solution.