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

How can I change the conductivity of a material using the Python API

asked 2022-06-22 11:04:35 -0500

RafaB's avatar

updated 2022-06-22 18:12:37 -0500

I am using the Python API and I would like to set the value of the conductivity of a material using Python. Any ideas?

edit retag flag offensive close merge delete


Which Material class are you looking to change? If it is an OpaqueMaterial you can do foo.setThermalConductivity(bar)

Luis Lara's avatar Luis Lara  ( 2022-06-28 11:53:24 -0500 )edit

The material is defined in the idl file.

RafaB's avatar RafaB  ( 2022-06-28 13:36:37 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-06-28 12:03:24 -0500

You can try something like

import openstudio

m = openstudio.model.Model()
material = openstudio.model.StandardOpaqueMaterial(m)
original_conductivity = material.thermalConductivity()

print ("The original conductivity was"+" "+str(original_conductivity)+" and the new conductivity is "+str(material.thermalConductivity()))

The original conductivity was 0.1 and the new conductivity is 0.2

Replace the material object with the object you want to change.

edit flag offensive delete link more


Also, you can refer to the documentation for every Class on https://openstudio-sdk-documentation....

Luis Lara's avatar Luis Lara  ( 2022-06-28 12:11:56 -0500 )edit

Thanks a lot Luis!

RafaB's avatar RafaB  ( 2022-06-28 13:32:49 -0500 )edit

I think @RafaB meant with the EnergyPlus Python API (Python EMS), not with openstudio. Didn't you? Given the tags..

Julien Marrec's avatar Julien Marrec  ( 2022-06-29 02:03:59 -0500 )edit

@Julien Marrec is right. I am using the Python API, but I am open to other approaches as well.

RafaB's avatar RafaB  ( 2022-06-29 08:57:58 -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: 2022-06-22 11:04:35 -0500

Seen: 240 times

Last updated: 2 days ago