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.
()
| 205 | |
| 206 | |
| 207 | def 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 |
no test coverage detected