mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 06:21:40 +00:00
Close #3377. Implement xyz coordinates for COBie object placement.
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user