From 281147367ec98260f56287a31eaa758643b995c2 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 4 Jul 2023 19:45:11 +1000 Subject: [PATCH] Close #3377. Implement xyz coordinates for COBie object placement. --- src/ifccobie/cobie.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ifccobie/cobie.py b/src/ifccobie/cobie.py index 9c42890e02..0c4c95a0e3 100755 --- a/src/ifccobie/cobie.py +++ b/src/ifccobie/cobie.py @@ -572,15 +572,17 @@ class IfcCobieParser: ) for coordinate in coordinates: 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] = { "CreatedBy": self.get_email_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 "SheetName": "Coordinates", "RowName": "n/a", - "CoordinateXAxis": coordinate.ObjectPlacement.RelativePlacement.Location.Coordinates[0], - "CoordinateYAxis": coordinate.ObjectPlacement.RelativePlacement.Location.Coordinates[1], - "CoordinateZAxis": coordinate.ObjectPlacement.RelativePlacement.Location.Coordinates[2], + "CoordinateXAxis": x, + "CoordinateYAxis": y, + "CoordinateZAxis": z, "ExtSystem": self.get_ext_system_from_history(coordinate.OwnerHistory), "ExtObject": self.get_ext_object(coordinate), "ExtIdentifier": coordinate.GlobalId,