ifcopenshell.api.style.unassign_representation_styles

Module Contents

class ifcopenshell.api.style.unassign_representation_styles.Usecase
execute()
remove_styles(item)

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: ifcopenshell.file, shape_representation: ifcopenshell.entity_instance, styles: list[ifcopenshell.entity_instance], should_use_presentation_style_assignment: bool = False) None

Unassigns styles directly assigned to an object representation

This does the inverse of assign_representation_styles.

Parameters:
  • 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.

Returns:

None

Return type:

None

Example:

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