MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / refresh_ui_data

Function refresh_ui_data

src/bonsai/bonsai/bim/handler.py:207–234  ·  view source on GitHub ↗

Refresh cached UI data. Note that calling non-ifc-operators by itself doesn't refresh the UI data and it need to be refreshed manually if needed.

()

Source from the content-addressed store, hash-verified

205
206
207def refresh_ui_data():
208 """Refresh cached UI data.
209
210 Note that calling non-ifc-operators by itself doesn't refresh the UI data
211 and it need to be refreshed manually if needed.
212 """
213 import bonsai.bim.ui
214 from bonsai.bim import modules
215
216 bonsai.bim.ui.refresh()
217
218 for name, value in modules.items():
219 try:
220 getattr(value, "data").refresh()
221 except AttributeError:
222 pass
223
224 # TODO: deprecate prop purge functions and refactor into data classes.
225 try:
226 getattr(value, "prop").purge()
227 except AttributeError:
228 pass
229
230 if isinstance(ifc_file := tool.Ifc.get(), ifcopenshell.sqlite):
231 ifc_file.clear_cache()
232
233 if tool.Web.get_web_props().is_connected:
234 tool.Web.send_webui_data()
235
236
237@persistent

Callers 7

update_profile_nameFunction · 0.90
_executeMethod · 0.90
name_callbackFunction · 0.85
active_object_callbackFunction · 0.85
loadIfcStoreFunction · 0.85
undo_postFunction · 0.85
redo_postFunction · 0.85

Calls 7

get_web_propsMethod · 0.80
send_webui_dataMethod · 0.80
refreshMethod · 0.45
itemsMethod · 0.45
purgeMethod · 0.45
getMethod · 0.45
clear_cacheMethod · 0.45

Tested by

no test coverage detected