Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Convert IDF geometry objects from Relative to World coordinate system

asked 2024-05-14 02:59:25 -0500

Tokarzewski's avatar

updated 2024-05-21 10:10:07 -0500


I would like to share with you a small python script that converts geometry from relative to world coordinate system in IDF files. Feel free to use it. Below I described a minimal quick start guide that you can follow.

  1. you should have python3 installed -
  2. eppy library installed -
  3. download the script from the github repository -
  4. check your idf version and install the same EP version from
  5. take the idd file from the instalated EnergyPlus folder.
  6. update the file paths for the idd and idf files inside the script.
  7. run the script using any IDE that supports python or just use a terminal.

Let me know if something didn't work or remains unclear.

edit retag flag offensive close merge delete


Has Someone a idea to fix this error? I don't understand it tbh

    this node -SPACE-is not present in base dictionary
    this node -ZONE MEAN AIR TEMPERATURE-is not present in base dictionary
  File "/home/burns/anaconda3/envs/PyFMI/lib/python3.9/site-packages/eppy/", line 29, in extension_of_extensible
    n = n // ext
TypeError: unsupported operand type(s) for //: 'int' and 'NoneType'
Burns's avatar Burns  ( 2024-05-21 04:40:31 -0500 )edit

@Burns, I don't understand this issue yet. Can you send me the idf and idd files so I can take a look?

Tokarzewski's avatar Tokarzewski  ( 2024-05-21 05:07:20 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2024-05-15 07:32:35 -0500

Burns's avatar

Nice! thx for that rich script. It worked for me on Linux with eplus v24.1, BUT I had to add the number of Vertices manually from "" to "4" for every surface:

  Surface 1,                              !- Name
  Floor,                                  !- Surface Type
  ExtSlabCarpet 4in ClimateZone 1-8,      !- Construction Name
  Thermal Zone 1,                         !- Zone Name
  Thermal Zone 1 Space,                   !- Space Name
  Ground,                                 !- Outside Boundary Condition
  ,                                       !- Outside Boundary Condition Object
  NoSun,                                  !- Sun Exposure
  NoWind,                                 !- Wind Exposure
  ,                                       !- View Factor to Ground
  4,                                       !- Number of Vertices
  0.966639036161356, -0.951827216061757, 0, !- X,Y,Z Vertex 1 {m}
  2.28789326978621, -6.29076786474157, 0, !- X,Y,Z Vertex 2 {m}
  -6.25441176810156, -8.40477463854147, 0, !- X,Y,Z Vertex 3 {m}
  -7.57566600172645, -3.06583398986163, 0; !- X,Y,Z Vertex 4 {m}

Maybe you could add for such cases something like this:

if "!- Number of Vertices" is "":
    contains_vertex = df.apply(lambda column: column.str.contains('Vertex', na=False)).any(axis=1)
    number_of_rows = contains_vertex.sum()


for line in file:
    if 'Vertex' in line:
        count += 1
edit flag offensive delete link more


The Number of Vertices field can be left blank and the number of vertices will be calculated internally. Does a blank field not work anymore?

  N2 , \field Number of Vertices
       \minimum 3
       \default autocalculate
rraustad's avatar rraustad  ( 2024-05-15 07:40:10 -0500 )edit

Would you be OK if we added this to eppy with you as the author (MIT license)

santoshphilip's avatar santoshphilip  ( 2024-05-20 15:14:26 -0500 )edit

@Burns Ahh, the update_detailed_object_coordinates function is using object.Number_of_Vertices but your idf have this field empty. I will improve the script.

Tokarzewski's avatar Tokarzewski  ( 2024-05-21 05:12:02 -0500 )edit

@santoshphilip I'm more than happy to have this contribution added to eppy under the MIT license. Please feel free to add it.

Tokarzewski's avatar Tokarzewski  ( 2024-05-21 05:23:01 -0500 )edit

@santoshphilip I am also happy to have this added to eppy under the MIT license.

Tiago Quevedo's avatar Tiago Quevedo  ( 2024-05-21 06:02:30 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops


Question Tools

1 follower


Asked: 2024-05-14 02:59:25 -0500

Seen: 63 times

Last updated: May 21