Module Contents

class ifcopenshell.api.style.unassign_representation_styles.Usecase

Removes styles from a styled item or a style assignment and purges item if doesn’t have any styles after

ifcopenshell.api.style.unassign_representation_styles.unassign_representation_styles(file, shape_representation=None, styles=None, should_use_presentation_style_assignment=False) None

Unassigns styles directly assigned to an object representation

This does the inverse of assign_representation_styles.

  • shape_representation (ifcopenshell.entity_instance) – The IfcShapeRepresentation of the object that you want to unassign styles from.

  • styles (list[ifcopenshell.entity_instance]) – A list of presentation styles, typically IfcSurfaceStyle. The number of items in the list should correlate with the number of items in the shape_representation’s Items attribute. If you have more items than styles, the last style is used.

  • should_use_presentation_style_assignment (bool) – This is a technical detail to accomodate a bug in Revit. This should always be left as the default of False, unless you are finding that colours aren’t showing up in Revit. In that case, set it to True, but keep in mind that this is no longer a valid IFC. Blame Autodesk.



Return type:



ifcopenshell.api.run("style.unassign_representation_styles", model,
    shape_representation=representation, styles=[style])