Why Edge door in wall is null?

Why Edge door in wall is null?

Anonymous
Not applicable
370 Views
2 Replies
Message 1 of 3

Why Edge door in wall is null?

Anonymous
Not applicable

I'm trying to get the edges of the door in the wall, in some cases I get 4 edges in some nothing at all.
I attach a model and a picture on which I designated a room, from whose doors I can not find the edges.

Two model files must be linked.
method produces null
List<Edge> FindEdges = wallOfDoor
.get_Geometry(new Options { ComputeReferences = true })
.OfType<Solid>()
.SelectMany(x => x.Edges.OfType<Edge>())
.Where(x => IsDoorEdge(x, door))
.Where(IsVerticalEdge)
.Where(x => IsWallExteriorFaceEdge(x, wallOfDoor.Orientation)).ToList();

0 Likes
371 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

when I remove the line of the condition in which the orientation of the wall is considered, then I find 2 edges

 

 .Where(x => IsWallExteriorFaceEdge(x, wallOfDoor.Orientation)).ToList();

0 Likes
Message 3 of 3

Anonymous
Not applicable

private static bool IsWallExteriorFaceEdge(Edge edge, XYZ wallOrientation)
{
return IsWallExteriorFace(edge.GetFace(0), wallOrientation)
|| IsWallExteriorFace(edge.GetFace(1), wallOrientation);
}

private static bool IsWallExteriorFace(Face face, XYZ wallOrientation)
{
return face.ComputeNormal(UV.Zero).DotProduct(wallOrientation) > 1E-3;
}

0 Likes