This is a fork of https://github.com/buildingsmart-community/ifcJSON to make the Python conversion scripts (IFC JSON <->IFC (STEP)) scripts work:
- on latest Debian/Ubuntu systems,
- with latest IfcOpenShell,
- read IFC JSON files produced by latest BonsaiBIM and Castle Game Engine (with
type="IFC.JSON"inside).
Summary of usage:
# install dependencies
sudo apt install python3 python3-pip
# optional if you want to just write "python" instead of "python3" below:
# sudo apt install python-is-python3
pip install ifcopenshell
# If above answers "error: externally-managed-environment":
# - Read what it says.
# - Consider using a virtual environment, as advised there.
# - If you want a quick way, on your own head be it:
pip install ifcopenshell --break-system-packages
# clone this repo
git clone https://github.com/michaliskambi/ifcJSON
# use the scripts; replace filenames below with your own:
cd ifcJSON/file_converters
python3 json2ifc.py -h
python3 json2ifc.py -i input.ifcjson -o output.ifc
# proper output should look like this:
# > Reading ifcJson file: ....
# > Conversion took .... seconds
python3 ifc2json.py -h
python3 ifc2json.py -i input.ifc -o output.ifcjson
# proper output should look like this:
# > Conversion took .... seconds
This repository contains the specification for ifcJSON-4 - version in sync with IFC EXPRESS Schema.
JSON is used throughout the world for exchanging and using data. Building data needs to be available in JSON. Therefore, IFC needs to be available in JSON format.
ifcJSON aims primarily at addressing the following problems with IFC:
- Many developers have never seen/used EXPRESS or STP instance files before, which increases the effort required to extract data required from them.
- IFC instance populations are typically exchanged as files, which is at odds with linked, distributed, and rapidly changing data seen on most design and construction projects and products.
ifcJSON seeks the best balance between a best practice JSON representation AND compatibility with the IFC source schema.
Main focus:
- Backward compatibility
- Round-trip
- Parallel to EXPRESS schema
To a lesser degree (Due to adhering to the IFC schema):
- Human-readability
- Integration with code
- Clear referencing structure
- Direct usability
The initial standard will be developed based on IFC4 and more specifically IFC4.3. IFC5 developments will be closely followed, especially for expected improvements in human-readability.
The repository is organised in different sections:
- Documentation: your starting point to find out what this ifcJSON is about
- Samples: ifcJSON data examples
- Schema: ifcJSON schemas
- File converters: Python tools for reading and converting between ifcJSON and IFC SPF
- Schema converters: Python tools for converting IFC schemas into JSON-Schema
Contributions are welcome in all possible ways. Your first starting point is creating GitHub issues. Feel free to get in touch with the people in the ifcJSON-team.