mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 03:37:58 +00:00
Fix #5799. Also purge presentation style assignment when purging unused styles.
This commit is contained in:
@@ -659,13 +659,15 @@ class Style(bonsai.core.tool.Style):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
ifc_file = tool.Ifc.get()
|
ifc_file = tool.Ifc.get()
|
||||||
elements = ifc_file.by_type("IfcPresentationStyle")
|
|
||||||
i = 0
|
i = 0
|
||||||
for element in elements:
|
if ifc_file.schema in ("IFC2X3", "IFC4"):
|
||||||
if ifc_file.get_total_inverses(element) != 0:
|
for element in ifc_file.by_type("IfcPresentationStyleAssignment"):
|
||||||
continue
|
if ifc_file.get_total_inverses(element) == 0:
|
||||||
bonsai.core.style.remove_style(tool.Ifc, tool.Style, element, reload_styles_ui=False)
|
ifc_file.remove(element)
|
||||||
i += 1
|
for element in ifc_file.by_type("IfcPresentationStyle"):
|
||||||
|
if ifc_file.get_total_inverses(element) == 0:
|
||||||
|
bonsai.core.style.remove_style(tool.Ifc, tool.Style, element, reload_styles_ui=False)
|
||||||
|
i += 1
|
||||||
return i
|
return i
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user