ifcopenshell.api.context.remove_context

Module Contents

ifcopenshell.api.context.remove_context.remove_context(file: ifcopenshell.file, context: ifcopenshell.entity_instance) None

Removes an IfcGeometricRepresentationContext

Any representation geometry that is assigned to the context is also removed. If a context is removed, then any subcontexts are also removed.

Parameters:

context (ifcopenshell.entity_instance) – The IfcGeometricRepresentationContext entity to remove

Returns:

None

Return type:

None

Example:

model = ifcopenshell.api.context.add_context(model, context_type="Model")
# Revit had a bug where they incorrectly called the body representation a "Facetation"
body = ifcopenshell.api.context.add_context(model,
    context_type="Model", context_identifier="Facetation", target_view="MODEL_VIEW", parent=model
)

# Let's just get rid of it completely
ifcopenshell.api.context.remove_context(model, context=body)