ifcopenshell.api.unit.unassign_unit

Module Contents

ifcopenshell.api.unit.unassign_unit.unassign_unit(file: ifcopenshell.file, units: list[ifcopenshell.entity_instance] | None = None) None

Unassigns units as default units for the project

Parameters:

units (list[ifcopenshell.entity_instance],optional) – A list of units to assign as project defaults.

Returns:

None

Return type:

None

Example:

# You need a project before you can assign units.
ifcopenshell.api.root.create_entity(model, ifc_class="IfcProject")

# Millimeters and square meters
length = ifcopenshell.api.unit.add_si_unit(model, unit_type="LENGTHUNIT", prefix="MILLI")
area = ifcopenshell.api.unit.add_si_unit(model, unit_type="AREAUNIT")

# Make it our default units, if we are doing a metric building
ifcopenshell.api.unit.assign_unit(model, units=[length, area])

# Actually, we don't need areas.
ifcopenshell.api.unit.unassign_unit(model, units=[area])