IFC viewer AnyWidget using That Open Company Open BIM Components
Project description
IFC viewer anywidget
Display an IFC model in your Jupyter/marimo notebook.
- Displays an
ifcopenshell.fileobject using the IFCLite viewer - returns the list of
GlobalIds of the selected elements viaselected_guidsattribute
install
If you're using marimo in sandbox mode, skip this part. Marimo will detect the import and ask you to install the package.
If you're running JupyterLab, add the library to your environment:
pip install ifc-anywidget
if you're using uv (highly recommended), run
uv add ifc-anywidget
usage
from ifc_anywidget import IfcViewer
import ifcopenshell
model = ifcopenshell.open("my-awesome-model.ifc")
viewer = IfcViewer(ifc_model=model) # for marimo: wrap it with mo.ui.anywidget()
viewer
IfcVewer supports the following attributes:
ifc_model: theifcopenshell.fileinstance to showhide_sites: whether to hide IfcSite elements (default: False)hide_spaces: whether to hide IfcSpace elements (default: True)hide_spatial_zones: whether to hide IfcSpatialZone elements (default: True)hide_opening_elements: whether to hide IfcOpeningElement elements (default: True)hide_annotations: whether to hide IfcAnnotation elements (default: True)hide_grids: whether to hide IfcGrid elements (default: True)
Using marimo, you can set these attributes reactively (for instance, with a toggle widget).
Take a look at the tests/test_marimo.py notebook to see an example.
development
Clone the repo and run uv sync to initialize the environment with all the needed dependencies.
For testing within marimo, just run
uv run marimo edit tests/test_marimo.py
For testing within jupyter lab, run
uv run jupyter lab tests/test_jupyter.ipynb
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ifc_anywidget-0.5.0.tar.gz.
File metadata
- Download URL: ifc_anywidget-0.5.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75b2607e8eee10d2cad1c83e5ca7a91b32cd92530dee53d27fbc3665ba07af50
|
|
| MD5 |
4bff2f782dc932a035336af5fc826675
|
|
| BLAKE2b-256 |
77f662ce8abfe5a20aaf8ce2631777a4b08be553366a6a6614b2fa248a57faa7
|
File details
Details for the file ifc_anywidget-0.5.0-py3-none-any.whl.
File metadata
- Download URL: ifc_anywidget-0.5.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1195812a05feff14927348068e675e797a2eccf38cfaf4b0b478aeea531da28b
|
|
| MD5 |
7b4011341170c2dccc20a6928aa630b8
|
|
| BLAKE2b-256 |
d2857e70d22d509f26d818fd4b362c1fb2b4a1824ad470e1c136bcf3481d4695
|