ifcopenshell.util.schema

Module Contents

class ifcopenshell.util.schema.BatchReassignClass(file: ifcopenshell.file)
purge() None
reassign(element: ifcopenshell.entity_instance, new_class: str) ifcopenshell.entity_instance
unbatch()
file
class ifcopenshell.util.schema.Migrator
find_equivalent_attribute(new_element: ifcopenshell.entity_instance, attribute: ifcopenshell.ifcopenshell_wrapper.attribute, element: ifcopenshell.entity_instance, attributes_mapping: dict[str, dict[str, str]], reverse_mapping: bool = False) Any | None
generate_default_value(attribute: ifcopenshell.ifcopenshell_wrapper.attribute, new_file: ifcopenshell.file) Any
migrate(element: ifcopenshell.entity_instance, new_file: ifcopenshell.file) ifcopenshell.entity_instance
migrate_attribute(attribute: ifcopenshell.ifcopenshell_wrapper.attribute, element: ifcopenshell.entity_instance, new_file: ifcopenshell.file, new_element: ifcopenshell.entity_instance, new_element_schema: ifcopenshell.ifcopenshell_wrapper.declaration) None
migrate_attributes(element, new_file, new_element, new_element_schema)
migrate_class(element: ifcopenshell.entity_instance, new_file: ifcopenshell.file) ifcopenshell.entity_instance
preprocess(old_file: ifcopenshell.file, new_file: ifcopenshell.file)
attribute_overrides
attributes_mapping
class_2x3_to_4
class_4_to_2x3
default_entities
default_values
migrated_ids
ifcopenshell.util.schema.get_fallback_schema(version: str) str

fallback to the schema version we do have docs and mapping for, needed to support IFC versions like 4X3_RC1, 4X1 etc

ifcopenshell.util.schema.get_subtypes(entity)
ifcopenshell.util.schema.is_a(entity: ifcopenshell.entity_instance, ifc_class: str) bool
ifcopenshell.util.schema.reassign_class(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance, new_class: str) ifcopenshell.entity_instance

Attempts to change the class (entity name) of element to new_class by removing element and recreating a similar instance of type new_class with the same id.

In certain cases it may affect the structure of inversely related instances: - Multiple occurrences of reassigned instance within the same aggregate

(such as start and end-point of polyline)

  • Occurrences of reassigned instance within an ordered aggregate (such as IfcRelNests)

It’s unlikely that this affects real-world usage of this function.

ifcopenshell.util.schema.cwd