ifcopenshell.api.context.remove_context

Module Contents

ifcopenshell.api.context.remove_context.remove_context(file: ifcopenshell.entity_instance, 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.run("context.add_context", model, context_type="Model")
# Revit had a bug where they incorrectly called the body representation a "Facetation"
body = ifcopenshell.api.run("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.run("context.remove_context", model, context=body)