Close #3377. Implement xyz coordinates for COBie object placement.

This commit is contained in:
Dion Moult
2023-07-04 19:45:11 +10:00
parent 0beea4255a
commit 281147367e
+5 -3
View File
@@ -572,15 +572,17 @@ class IfcCobieParser:
) )
for coordinate in coordinates: for coordinate in coordinates:
coordinate_name = "{}/{}".format(coordinate.is_a(), self.get_object_name(coordinate)) coordinate_name = "{}/{}".format(coordinate.is_a(), self.get_object_name(coordinate))
mat = ifcopenshell.util.placement.get_local_placement(coordinate.ObjectPlacement)
x, y, z = mat[:,3][:3]
self.coordinates[coordinate_name] = { self.coordinates[coordinate_name] = {
"CreatedBy": self.get_email_from_history(coordinate.OwnerHistory), "CreatedBy": self.get_email_from_history(coordinate.OwnerHistory),
"CreatedOn": self.get_created_on_from_history(coordinate.OwnerHistory), "CreatedOn": self.get_created_on_from_history(coordinate.OwnerHistory),
"Category": "Location", # I am not sure what this mapping is meant to be "Category": "Location", # I am not sure what this mapping is meant to be
"SheetName": "Coordinates", "SheetName": "Coordinates",
"RowName": "n/a", "RowName": "n/a",
"CoordinateXAxis": coordinate.ObjectPlacement.RelativePlacement.Location.Coordinates[0], "CoordinateXAxis": x,
"CoordinateYAxis": coordinate.ObjectPlacement.RelativePlacement.Location.Coordinates[1], "CoordinateYAxis": y,
"CoordinateZAxis": coordinate.ObjectPlacement.RelativePlacement.Location.Coordinates[2], "CoordinateZAxis": z,
"ExtSystem": self.get_ext_system_from_history(coordinate.OwnerHistory), "ExtSystem": self.get_ext_system_from_history(coordinate.OwnerHistory),
"ExtObject": self.get_ext_object(coordinate), "ExtObject": self.get_ext_object(coordinate),
"ExtIdentifier": coordinate.GlobalId, "ExtIdentifier": coordinate.GlobalId,