New utility function to get storey elevations with elevation attribute fallback for more compliant sorting of building storey elevations.

This commit is contained in:
Dion Moult
2021-10-18 12:39:04 +11:00
parent a9a48bdd1d
commit 699ccddda3
4 changed files with 75 additions and 46 deletions
@@ -24,3 +24,10 @@ def get_local_placement(plc):
else:
parent = get_local_placement(plc.PlacementRelTo)
return np.dot(parent, get_axis2placement(plc.RelativePlacement))
def get_storey_elevation(storey):
if storey.ObjectPlacement:
matrix = get_local_placement(storey.ObjectPlacement)
return matrix[2][3]
return getattr(storey, "Elevation", 0.0) or 0.0