I am trying to find the name of a material on an object’s face where two objects meet/intersect. Does anyone know of a way to get the material of a face?
Thank you, ORGANON for your reply. For the past couple days I’ve been banging my head against this error: “AttributeError: ‘Face’ object has no attribute ‘MaterialElementId’”
How did you get the faces?
The image below is my sequence so far. Taking your question as a hint, I looked into getting faces from Revit objects and found this post:
So I’m now trying to fit that code into mine and I’m now receiving this error: “TypeError: GetElement() takes exactly 2 arguments (1 given)”
API documentation also lists 1 argument (Reference, String or ElementId). Thanks for your patience and help!
Ok in case it’s helpful (and in case I’m going about this completely the wrong way or reinventing the wheel) here’s what I’m trying to accomplish:
I am making the room objects “aware” of their surrounding materials (walls, floors, ceilings, etc). I’ve already created a Dynamo script that picks up the floor type but that’s limited and required the users to name the floor types a certain way. Also it doesn’t work in the same way for walls and other objects that might be in the room. So the end result of this effort is for the room to grab the face material of outer-most surface (face material specifically as a catch for painted materials). Then I can easily catch the Mark from the materials and carry on.
As Organon hinted above, you’ll need to extract the actual revit face to get the material id property. You can do that with Clockwork’s “RevitFace.FromDynamoSurface” node.
To get the correct faces, consider shooting rays from the centroid of the room to the exterior boundaries. You can do that with the “RayBounce.ByOriginDirection”.
If you use Clockwork’s “Room.Boundaries” node, you can get all the vertical elements(walls, partitions, facades) directly and limit the ray tracing to just horizontal elements(ceilings roofs).
I was following this discussion, and was wondering how could we get to a density material parameters?
Great work, Organon. I wasn’t aware of that method.
Pawel, have a look in the below discussion:
Thanks, but it's not my solution. Here is the code: http://help.autodesk.com/view/RVT/2014/ENU/?guid=GUID-E7B451BB-21DC-4D72-AD26-75F0C2E911E4
Thanks a lot! You just cant imagine how much time did I spend going trough the API documentation to find how this works! Awesome!
Brilliant! Thank you all for the great tips! Organon I saw another response you put on github but I was having trouble with using it for lists. This works great. I’ll post the result after I’ve worked some things out