Difference between revisions of "Ifccityjson"
(Created page with "== Installation == 1. Install dependencies IfcCityJSON is a python library that is based on two libraries: IfcOpenShell (for IFC manipulation) and CJIO (for CityJSON manipulat...") |
m (Change place where to download IfcOpenShell-python with API) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Installation == | == Installation == | ||
− | + | Install dependencies: CJIO & IfcOpenShell-python | |
+ | |||
IfcCityJSON is a python library that is based on two libraries: IfcOpenShell (for IFC manipulation) and CJIO (for CityJSON manipulation). These need to be installed first. CJIO (python 3.6+ only) is installed with: | IfcCityJSON is a python library that is based on two libraries: IfcOpenShell (for IFC manipulation) and CJIO (for CityJSON manipulation). These need to be installed first. CJIO (python 3.6+ only) is installed with: | ||
Line 7: | Line 8: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | The IfcOpenShell-python library is needed (with API included). Unfortunately, the API is not yet | + | The IfcOpenShell-python library is needed (with API included). Unfortunately, the API is not yet shipped with the releases on [http://www.ifcopenshell.org/python www.ifcopenshell.org/python], but [https://github.com/IfcOpenBot/IfcOpenShell/commit/93c5906ad7f363fd1b1d9e49eb28d10212ce9173#comments this IfcOpenShell commit] has the API included. Copy this folder to your python site-packages folder, that is found under your python folder/Lib (for example: 'C:/Users/user/AppData/Local/Programs/Python/Python39/Lib/site-packages'). |
== Usage == | == Usage == |
Latest revision as of 14:08, 2 November 2021
Installation[edit]
Install dependencies: CJIO & IfcOpenShell-python
IfcCityJSON is a python library that is based on two libraries: IfcOpenShell (for IFC manipulation) and CJIO (for CityJSON manipulation). These need to be installed first. CJIO (python 3.6+ only) is installed with:
python -m pip install cjio
The IfcOpenShell-python library is needed (with API included). Unfortunately, the API is not yet shipped with the releases on www.ifcopenshell.org/python, but this IfcOpenShell commit has the API included. Copy this folder to your python site-packages folder, that is found under your python folder/Lib (for example: 'C:/Users/user/AppData/Local/Programs/Python/Python39/Lib/site-packages').
Usage[edit]
Now both packages are installed, IfcCityJSON is ready to be used. Download the repo https://github.com/IfcOpenShell/IfcOpenShell and navigate to src/ifccityjson. Open your command prompt in this directory. The following command will execute a conversion from CityJSON to IFC.
python ifccityjson.py [-i input file] [-o output file] [-n name of identification attribute]
So, for example, you would like to convert the file C:/Users/user/Documents/3DBAG.json, where the naming attribute is 'identificatie' this is possible with the following command:
python ifccityjson.py -i C:/Users/user/Documents/3DBAG.json -o C:/Users/user/Documents/3DBAG.ifc -n identificatie
This will provide an IFC file 3DBAG.ifc that can be opened with your favourite IFC viewer!