ifcpatch.recipes.ResetSpatialElementLocations

Module Contents

class ifcpatch.recipes.ResetSpatialElementLocations.Patcher(file: ifcopenshell.file, logger: logging.Logger, ifc_class: str = '', only_xy: bool = True)

Resets the location of non-geometric spatial elements to 0,0,0

Often, non-geometric spatial elements are located at arbitrary locations relative to the model. Because they are non-geometric but still contain placements, many users do not realise that their coordinates are actually ver far away and can cause precision issues if “fit all in view” is used.

This patch lets you selectively reset the location of spatial elements (sites, buildings, storeys) back to 0,0,0. This is typically done after other coordinate operation patches. Alternatively, consider using the SetFalseOrigin patch which can do this operation built-in.

Parameters:
  • ifc_class – The class of spatial element to reset coordinates for. Leave blank if you want to reset everything.

  • only_xy – If True, only the X and Y coordinates will be affected.

Example:

# All IfcSites will shift back to 0,0,0.
ifcpatch.execute({"file": model, "recipe": "ResetSpatialElementLocations", "arguments": ["IfcSite"]})
patch() None
patch_placement_to_origin(element: ifcopenshell.entity_instance) None
file
ifc_class = ''
logger
only_xy = True