ifcpatch.recipes.ConvertLengthUnit

Module Contents

class ifcpatch.recipes.ConvertLengthUnit.Patcher(src: str, file: ifcopenshell.file, logger: logging.Logger, unit: LengthUnit = 'METER')

Converts the length unit of a model to the specified unit

Allowed metric units include METER, MILLIMETER, CENTIMETER, etc. Allowed imperial units include INCH, FOOT, MILE.

Parameters:

unit (LengthUnit) – The name of the desired unit, defaults to “METER”

Example:

# Convert to millimeters
model = ifcpatch.execute({"input": "input.ifc", "file": model, "recipe": "ConvertLengthUnit", "arguments": ["MILLIMETER"]})

# Convert to feet
model = ifcpatch.execute({"input": "input.ifc", "file": model, "recipe": "ConvertLengthUnit", "arguments": ["FOOT"]})
patch()
file
file_patched: ifcopenshell.file
logger
src
unit
ifcpatch.recipes.ConvertLengthUnit.LengthUnit