Hi,
I need to find all the faces of the room, except the faces that belong to certain walls.
I get solid of room, get some faces, but I can't get faces only need me walls.
how to define an element (for example, a wall) knowing face of room?
In Revit API whet I using room, I get many Faces, in this Faces can be some subFace. In subFace I can get HostElementId, with the help of which I can determine the wall of which it belongs. But how know HostElementId of Face?
Is there a possibility in Revit API to determine the wall from Face of the room?
Please help
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
Hey,
What you want to do is unclear to me, but getting the walls surrounding a Room is easy :
myRoom.GetBoundarySegments
gives you all the segments closing the room, and you can get the Id of all the elements which support these segments.
Benoit
GetBoundarySegments give me only ids of wall. Solid give me only faces and edges.But I need to determine which faces belong only to the wall.
When you have your wall using GetBoundarySegment you can get its geometry using get_Geometry, then retrieve its faces by casting the GeometryElement into Faces ?
So you could compare with the list of faces obtained using Solid ?
GetBoundarySegments give me only ids of wall. From this walls i can get all faces , but I need only faces of room. I use Solid of room. Its give me only faces and edges of room. But I need to determine which faces belong only to the wall.
face of wall and face of room are not the same thing.
foreach (SpatialElementBoundarySubface subface in subfaceList)
{
if (subface.SubfaceType==SubfaceType.Side)
{
Element wall = doc.GetElement(subface.SpatialBoundaryElement.HostElementId);
}
}
i can get subface from face.I get wall from subface subface.SpatialBoundaryElement.HostElementId property.
how does it happen that the face does not have such a property?
I need to get all the faces inside the room, but excluding the faces of certain walls (for example, exterior walls). I use the room.getgeometry to get all the faces of the room. I get all the faces of the room, but now I can not define the faces of which walls are these faces. And I need at this stage to filter them, but i can't(((
Look at
And, for more examples:
Cheers,
Jeremy
thanks for the answer, but I'm not looking cut area,
I'm need get walls Name from Face, is it possible?
i'm not need determine wall opening areas per room.
I need all the faces of the room, except those that belong to certain walls (for example external wall, I define them using the name of the wall "external"). I need to get all the necessary faces and install on it electrical sockets at a distance of 4 meters.
from the solid of the room I have already got all the faces, but I do not know how to determine which faces to which wall belongs.
Please help me find the necessary edges, and connect them in a line, and insert a certain distance rosette, can have a similar example?
I believe in you
what if i get the faces of the walls and the faces of the room, and find the intersection curves of these faces
and if face of wall which i don't need and some face from room do not intersect and are closest to each other
Then this face i don't need?
what do you think?
Thanks
I did not try to solve your problem so I am just guessing.
You say the faces of your Room and of your Walls are not the same. Which means that 2 objects with geometries that are close are not referenced as the same object. In fact when you think about it it looks logical (the wall can have more than 1 Room on one of its faces).
So what you have to do is indeed verify if the geometry of the face of your Room is included in the geometry of the face of the wall (I don't see examples of the contrary). You could use Boolean operations for this : find the intersection between your 2 geometric surfaces (not the function of Revit though, it is designed for Solids not for 2D geometric operations).
You can see this discussion about Boolean operations :
https://forums.autodesk.com/t5/revit-api-forum/union-of-2-surfaces/m-p/7486222#M25918
Benoit
I used an example to find external walls. It unfortunately does not please when there are several walls nearby as in the picture, when there are two walls that stand side by side but there is no room between them. In this case, such walls are considered external. But they are not external. How to be in this case?
IList<SpatialElementBoundarySubface> subfaceList1 = results.GetBoundaryFaceInfo(face); // get the sub-faces for the face of the room
foreach (SpatialElementBoundarySubface subface in subfaceList1)
{
ElementId elemid = subface.SpatialBoundaryElement.HostElementId;
Element elem = doc.GetElement(elemid);
if (elem is Wall)
{
Wall wall = elem as Wall;
IList<ElementId> op = wall.FindInserts(true, false, true, true);
foreach (ElementId elementId in op)
{
listelementfromwall.Add(doc.GetElement(elementId));
}
}
}
Here is my code for getting the Elements. I get them from faces. First I get the Elementid
Then elements. some times I get parts of the doors, but how do I get to get whole? With some rooms, it turns out, with some not. Probably because they are complex and consist of many parts
wash in different rooms I get FamilyInstance - Door void.
The doors in the rooms have components(Door void, hand). Using the method above, I tried to find doors on the sides of the room. Sometimes it turned out, sometimes I find a part of the door instead of FamilyInstance, sometimes I do not find anything, although I know that there is a door.
I'm confused. I have been studying this problem for a long time and I can not find a solution in any way. Why does the method behave so differently and how to find a solution?
hi,
You can try to find the corresponding surface of the wall according to the edge line of the room.
Have you solved this problem?
Can't find what you're looking for? Ask the community or share your knowledge.