Skip to main content

Python-based command line tool for converting IFC files to Openstudio models

Project description

ifc2osmod

Introduction

  • actively being developed, still very unstable
  • Commandline tools written in Python to convert IFC models to Openstudio Models
    • ifcarch2osmod.py: input a IFC file and it will extract all the relevant information from the model and convert it to Openstudio format (.osm).
    • idf2osmod.py: input a EP+ idf file and it will extract all the relevant information from the model and convert it to Openstudio format (.osm).
    • osmod2ifc.py: input an Openstudio format (.osm) and it will extract all the relevant information from the model and convert it to IFC.
  • utility tools:

Installation

  • clone or download the project from github
  • pip install dependencies listed in the pyproject.toml file

Getting started

ifcarch2osmod + add_sch2osmod + execute_osmod example

  • execute the following command to run an example file. In this command, we first convert an IFC file to OSM file using ifc2osmod.py. Then pipe in the generated OSM file path into the execute_osmod.py program.
    ifcarch2osmod -i ../test_data/ifc/small_office.ifc -o ../results/osmod/small_office.osm | add_sch2osmod -p -b "Small Office" -c 1A | execute_osmod -p -e ../test_data/epw/miami/USA_FL_Miami.Intl.AP.722020_TMY3.epw -d ../test_data/epw/miami/USA_FL_Miami.Intl.AP.722020_TMY3.ddy -m ../test_data/json/measure_sel.json -out ../results/osmod/small_office_radiant_pnls
    

Development

Instructions

  1. go to the ifc2osmod directory
    cd ifc2osmod/src
    

ifcarch2osmod.py + add_sch2osmod.py + execute_osmod.py example

  • execute the following command to run an example file. In this command, we first convert an IFC file to OSM file using ifc2osmod.py. Then pipe in the generated OSM file path into the execute_osmod.py program.
    python -m ifc2osmod.ifcarch2osmod -i ../test_data/ifc/small_office.ifc -o ../results/osmod/small_office.osm | python -m ifc2osmod.add_sch2osmod -p -b "Small Office" -c 1A | python -m ifc2osmod.execute_osmod -p -e ../test_data/epw/miami/USA_FL_Miami.Intl.AP.722020_TMY3.epw -d ../test_data/epw/miami/USA_FL_Miami.Intl.AP.722020_TMY3.ddy -m ../test_data/json/measure_sel.json -out ../results/osmod/small_office_radiant_pnls
    
    python -m ifc2osmod.ifcarch2osmod -i ../test_data/ifc/small_office.ifc -o ../results/osmod/small_office.osm | python -m add_sch2osmod -p -b "Small Office" -c 1A | python -m execute_osmod -p -e ../test_data/epw/miami/USA_FL_Miami.Intl.AP.722020_TMY3.epw -d ../test_data/epw/miami/USA_FL_Miami.Intl.AP.722020_TMY3.ddy -m ../test_data/json/measure_sel.json
    
  • The results are stored in the 'ifc2osmod/results' folder. You can examine the files using the OpenStudio Application (https://github.com/openstudiocoalition/OpenStudioApplication/releases). Download version >= 1.7.0 to view the OSM generated from this workflow.

ifcarch2osmod.py + add_sch2osmod.py example

  • execute the following command to run an example file. In this command, we first convert an IFC file to OSM file using ifc2osmod.py. Then pipe in the generated OSM file path into the add_sch2osmod.py program.
    python -m  ifc2osmod.ifcarch2osmod -i ../test_data/ifc/small_office.ifc -o ../results/osmod/small_office.osm | python -m add_sch2osmod -p -b "Small Office" -c 1A
    
  • The results are stored in the 'ifc2osmod/results' folder. You can examine the files using the OpenStudio Application (https://github.com/openstudiocoalition/OpenStudioApplication/releases). Download version >= 1.7.0 to view the OSM generated from this workflow.

idf_transition.py example

  • execute the following command to run an example file. In this command, we update an idf file from 22.1 -> 23.2
    python -m ifc2osmod.idf_transition -u /EnergyPlus-23.2.0-7636e6b3e9-Linux-Ubuntu22.04-x86_64/PreProcess/IDFVersionUpdater -i ../test_data/idf/ASHRAE901_OfficeSmall_STD2022_Miami.idf -o ../results/idf/ASHRAE901_OfficeSmall_STD2022_Miami_23.2.idf -c 22.1 -t 23.2
    
    python -m ifc2osmod.idf_transition -u /EnergyPlus-23.2.0-7636e6b3e9-Linux-Ubuntu22.04-x86_64/PreProcess/IDFVersionUpdater -i ../test_data/idf/ASHRAE901_OfficeMedium_STD2007_Miami.idf -o ../results/idf/ASHRAE901_OfficeMedium_STD2007_Miami_23.2.idf -c 22.1 -t 23.2
    

idf2osmod.py example

  • execute the following command to run an example file. In this command, we convert an idf file to openstudio format
    python -m ifc2osmod.idf2osmod -i ../test_data/idf/ASHRAE901_OfficeSmall_STD2022_Miami_23.2.idf -o ../results/osmod/idf2osmod_ASHRAE901_OfficeSmall_STD2022_Miami.osm
    
    python -m ifc2osmod.idf2osmod -i ../test_data/idf/ASHRAE901_OfficeMedium_STD2007_Miami_23.2.idf -o ../results/osmod/idf2osmod_ASHRAE901_OfficeMedium_STD2007_Miami.osm
    

osmod2ifcarch.py example

  • execute the following command to run an example file. In this command, we convert an .osm file to IFC
    python -m  ifc2osmod.osmod2ifcarch -o ../test_data/osmod/idf2osmod_ASHRAE901_OfficeSmall_STD2022_Miami.osm -i ../results/ifc/idf2osmod_ASHRAE901_OfficeSmall_STD2022_Miami.ifc
    
    python -m ifc2osmod.osmod2ifcarch -o ../test_data/osmod/idf2osmod_ASHRAE901_OfficeMedium_STD2007_Miami.osm -i ../results/ifc/idf2osmod_ASHRAE901_OfficeMedium_STD2007_Miami.ifc
    

idf2osmod.py + osmod2ifcarch.py example

  • you can pipe the result of idf2osmod.py into the osmod2ifcarch.py program.
    python -m  ifc2osmod.idf2osmod -i ../test_data/idf/ASHRAE901_OfficeSmall_STD2022_Miami_23.2.idf -o ../results/osmod/idf2osmod_ASHRAE901_OfficeSmall_STD2022_Miami.osm | python -m ifc2osmod.osmod2ifcarch -p -i ../results/ifc/idf2osmod_ASHRAE901_OfficeSmall_STD2022_Miami.ifc
    

freecad_custom_pset.py example

python -m ifc2osmod.freecad_custom_pset -j ../data/json/ifc_psets/ -c ../results/csv/CustomPsets.csv

read_ifc_mat_pset.py example

  • generate json file
    python -m ifc2osmod.read_ifc_mat_pset -i ../test_data/ifc/idf2osmod_ASHRAE901_OfficeSmall_STD2022_Miami.ifc -r ../results/json/mat_pset.json
    
  • generate csv file
    python -m ifc2osmod.read_ifc_mat_pset -i ../test_data/ifc/idf2osmod_ASHRAE901_OfficeSmall_STD2022_Miami.ifc -r ../results/csv/mat_pset.csv -c
    

read_ifc_envlp_mat_pset.py example

  • generate json file
    python -m ifc2osmod.read_ifc_envlp_mat_pset -i  ../test_data/ifc/idf2osmod_ASHRAE901_OfficeSmall_STD2022_Miami.ifc -r ../results/json/ifc_env_info.json
    
  • generate csv file
    python -m ifc2osmod.read_ifc_envlp_mat_pset -i  ../test_data/ifc/idf2osmod_ASHRAE901_OfficeSmall_STD2022_Miami.ifc -r ../results/csv/ifc_env_info.csv -c
    

calc_massless_mat.py example

  • generate json file
    python -m ifc2osmod.calc_massless_mat -i  ../test_data/ifc/idf2osmod_ASHRAE901_OfficeSmall_STD2022_Miami.ifc -r ../results/json/massless_mat_info.json
    
  • generate csv file
    python -m ifc2osmod.calc_massless_mat -i  ../test_data/ifc/idf2osmod_ASHRAE901_OfficeSmall_STD2022_Miami.ifc -r ../results/csv/massless_mat_info.csv -c
    

extract_osmod_opq_constr.py example

python -m ifc2osmod.extract_osmod_opq_constr -o  ../test_data/osmod -r ../results/json/osmod_opq_constr_info.json

extract_osmod_glz_constr.py example

python -m ifc2osmod.extract_osmod_smpl_glz_constr -o  ../test_data/osmod -r ../results/json/osmod_smpl_glz_constr_info.json

eplus_sql2csv.py example

python -m ifc2osmod.epsql2csv -s ../results/osmod/small_office_wrkflw/run/eplusout.sql -r ../results/csv/

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

ifc2osmod-0.0.3.tar.gz (251.7 kB view details)

Uploaded Source

Built Distribution

ifc2osmod-0.0.3-py3-none-any.whl (280.0 kB view details)

Uploaded Python 3

File details

Details for the file ifc2osmod-0.0.3.tar.gz.

File metadata

  • Download URL: ifc2osmod-0.0.3.tar.gz
  • Upload date:
  • Size: 251.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.5

File hashes

Hashes for ifc2osmod-0.0.3.tar.gz
Algorithm Hash digest
SHA256 797e8c19baa9388316df43675ca011d6b753a7489e3518e458d36f658f22e6e0
MD5 93f473187f29dd2f86e849cca48bb7dc
BLAKE2b-256 163515be1d4210ecba98f7851ed27cd2f0ad2c49d91ac9b31069d82e4ead0ce4

See more details on using hashes here.

File details

Details for the file ifc2osmod-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ifc2osmod-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 280.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.5

File hashes

Hashes for ifc2osmod-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 eb180c9a8e096c5e8799126b736c8745a6f56f5ed739fd4f4b92b65831d29d8f
MD5 5759b5f290a03090fd5b0687a9eaef64
BLAKE2b-256 7e73867bff4a6c31e14878dec1e1ad187435f212b90a291568079614ff87d23e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page