Skip to content

michaliskambi/ifcJSON

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python scripts to do IFC JSON <-> IFC (STEP) conversion

About this fork (michaliskambi/ifcJSON)

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

ifcJSON-4

This repository contains the specification for ifcJSON-4 - version in sync with IFC EXPRESS Schema.

What

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:

  1. Many developers have never seen/used EXPRESS or STP instance files before, which increases the effort required to extract data required from them.
  2. 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.

Getting started

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

More information

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.

About

Repository containing the specification for IFC.JSON

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%