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

mattkoch's profile - activity

2024-03-29 17:01:47 -0500 commented question Applying measures in Python workflow and simulating

... not enough space in comment, see sort-of-answer below ...

2024-03-29 17:00:56 -0500 answered a question Applying measures in Python workflow and simulating

FWIW, I have had good success with the following, after "import openstudio" and creating or loading a model. # Make su

2024-03-29 15:24:14 -0500 marked best answer Why does model.save(path) fail with path an openstudio.path()?

I just upgraded from openstudio-3.6.0 SDK to opnstudio-3.7.0 SDK in Python. The following simple test used to work in 3.6.0:

import openstudio
model = openstudio.model.Model()
path = openstudio.path("./ModelTest.osm")
model.save(path)

However, in 3.7.0, I receive the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Python-3.10.11\lib\site-packages\openstudio\openstudioutilitiesidf.py", line 1997, in save
    return _openstudioutilitiesidf.Workspace_save(self, p, overwrite)
TypeError: Wrong number or type of arguments for overloaded function 'Workspace_save'.
  Possible C/C++ prototypes are:
    openstudio::Workspace::save(openstudio::path const &,bool)
    openstudio::Workspace::save(openstudio::path const &)

Interestingly, the following does seem to work instead, namely using a simple Python String instead of an OpenStudio Path:

import openstudio
model = openstudio.model.Model()
path = "./ModelTest.osm"
model.save(path)

Is there some type incompatibility going on? A "pip freeze" does confirm that I am using openstudio-3.7.0 in my Python-3.10.11.

2024-03-29 15:24:08 -0500 commented answer Why does model.save(path) fail with path an openstudio.path()?

No problem, Julien Marrec. If you are the driving force behind the Python port of openstudio, then the world owes you a

2024-03-29 13:44:48 -0500 edited question Why does model.save(path) fail with path an openstudio.path()?

Why does model.save(path) fail with path an openstudio.path()? I just upgraded from openstudio-3.6.0 SDK to opnstudio-3.

2024-03-29 13:44:01 -0500 asked a question Why does model.save(path) fail with path an openstudio.path()?

Why does model.save(path) fail with path an openstudio.path()? I just upgraded from openstudio-3.6.0 SDK to opnstudio-3.

2024-03-28 22:02:38 -0500 marked best answer Where is MeasureStep in Python version of OpenStudio SDK?

I was hoping to implement MeasureStep in a Python script. Much like "model = openstudio.model.Model()" or "space = openstudio.model.Space(model)", or "vector = openstudio.Vector3d(1.0,2.0,3.0)," I expected MeasureStep to be accessible as "measure_step = openstudio.MeasureStep(measure_directory)" after an "import openstudio" in my "test.py" file. Alas, I am being told by the Python interpreter there is none such. And "measure_step = openstudio.utilities.MeasureStep()" or "measure_step = openstudio.workflowJSON.MeasureStep()" or similar variations do not lead to success either. Has MeasureStep not been implemented yet in the openstudio SDK Python module? Or if it was, where can it be found? On a side note, is there an openstudio-standards for Python yet? Thanks.

2024-03-28 22:02:07 -0500 commented answer Where is MeasureStep in Python version of OpenStudio SDK?

Confirmed, openstudio-3.7.0 works in Windows as well: Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MS

2024-03-28 21:43:56 -0500 commented answer Where is MeasureStep in Python version of OpenStudio SDK?

I am running openstudio-3.6.0, below is the python output. >>> import openstudio >>> test=openstudio.

2024-03-27 20:38:12 -0500 asked a question Where is MeasureStep in Python version of OpenStudio SDK?

Where is MeasureStep in Python version of OpenStudio SDK? I was hoping to implement MeasureStep in a Python script. Much

2023-05-17 10:41:28 -0500 marked best answer ASHRAE 90.1-2016 Appendix G PRM

OK, so I am a bit confused about "create baseline" measures. There is one I can find under Whole Building/Space Types and it is called "Create Baseline Building" I know how to invoke this (Apply Measure Now), but unfortunately it goes no further than ASHRAE 90.1-2013.

Then there seems to be a "Create Performance Rating Method Baseline Building" method in the openstudio-standard GEM, which might (or not?) go to ASHRAE 90.1-2016, but which I do not know how to invoke (do I have to call this from within a custom measure?). Has anyone successfully used any (which?) measure along these lines to create an ASHRAE 90-1-2016 Appendix G Performance Rating Baseline?

I know there is also a "Space Type and Construction Set Wizard" measure, and it does go to ASHRAE 90.1-2016, but as the name says, it ends at Space Types and Constructions, i.e. does not include Lighting or HVAC.

Any enlightenment would be much appreciated!

2023-05-08 19:46:37 -0500 edited answer Swimming Pool in OpenStudio

Eric Ringold hit the nail on the head. Adding a thermal zone did indeed solve this problem. Thank you! And Denis Bourgeo

2023-05-08 19:45:39 -0500 answered a question Swimming Pool in OpenStudio

Eric Ringold hit the nail on the head. Adding a thermal zone did indeed solve this problem. Thank you! And Denis Bourgeo

2023-05-07 20:36:22 -0500 commented question Swimming Pool in OpenStudio

... see Additional Update in original post above.

2023-05-07 20:34:48 -0500 edited question Swimming Pool in OpenStudio

Swimming Pool in OpenStudio I tried to implement a swimming pool following this post on Unmet Hours. If I just create th

2023-05-07 20:12:06 -0500 commented question Swimming Pool in OpenStudio

OK, this is rather curious. I just used a batch file (oneliner.bat) file with following content: D:\OpenStudio-3.4.0\bi

2023-05-06 16:28:45 -0500 edited question Swimming Pool in OpenStudio

Swimming Pool in OpenStudio I tried to implement a swimming pool following this post on Unmet Hours. If I just create th

2023-05-05 23:08:00 -0500 asked a question Swimming Pool in OpenStudio

Swimming Pool in OpenStudio I tried to implement a swimming pool following this post on Unmet Hours. If I just create th

2023-02-10 22:15:04 -0500 edited answer OpenStudio 3.4.0 Python subsurface intersect/match

This is getting to be pretty long so I want to close this off by stating that macumber had suggested intersection does n

2023-02-10 22:14:24 -0500 marked best answer OpenStudio 3.4.0 Python subsurface intersect/match

I am working on a geometry modeler for OpenStudio. I am doing this in FreeCAD 0.20.1 because of its parametric nature, its Python backbone and its open availability (as opposed to SketchUp these days), and I am pairing it with the Python version of the OpenStudio 3.4.0 library (Thank You for porting it to Python!).

At this point, I can generate buildings with or without EXTERIOR windows/doors, and they show up and seem to run OK in OpenStudioApp 1.4.0 (with OpenStudio 3.4.0). I can also change the "3.4.0" to "2.9.1" in the .osm file, then add an extra line to all SubSurface entries (seems like Shading Control was dropped for later versions of OS?), and then open it in the old OpenStudio 2.9.1 SketchUp plugin, and it seems to then show up OK there as well.

To achieve surface intersecting and matching, I am using the following functions from the Python version of the OpenStudio 3.4.0 library:

import openstudio

...

openstudio.model.intersectSurfaces(spaces)
openstudio.model.matchSurfaces(spaces)

where spaces is an OpenStudio space vector like so:

spaces = openstudio.model.SpaceVector()

Like I said, so far, so good. However, this fails when I add INTERIOR windows or doors. Then the intersecting and matching no longer work. But, I can still modify the .osm file as indicated and open it up in the OpenStudio 2.9.1 SketchUp plugin. There I can then first do an intersect and then a match, and then it magically seems to work!

So, I was just wondering if this might ring a bell with anyone, maybe along the lines of intersect/match working OK in 2.9.1 Ruby but not OK in 3.4.0 Python or some such? Are there alternative OpenStudio Python functions?

As a bonus question, I was hoping to change the version from 3.4.0 to 2.9.1 via an OpenStudio Python function, so I don't have to edit the .osm file I create from FreeCAD manually and after the fact? I can't seem to find anything about that.

EDIT after logging <<<

I placed the following near the beginning of "it all":

logger = openstudio.FileLogSink("E:/OpenStudio/Measures/Python/test.log")
logger.setLogLevel(openstudio.Debug)

That seems to result in information being recorded to test.log. The outputs are as follows - it is long, so excerpts here only.

Each of the three versions has a bunch of the following:

[openstudio.model.PlanarSurface] <-2> Before setVertices have 11 fields.
[openstudio.model.PlanarSurface] <-2> After clearExtensibleGroups in setVertices have 11 fields.
[openstudio.model.PlanarSurface] <-2> After setVertices have 23 fields.  Size of vertices is 4.

Version 1 (no windows)

... interspersed with a bunch of the above are these three parts:

[openstudio.model.Surface] <-1> Intersection of 'Surface 3' with 'Surface 7' results in (Surface 3), (Surface 7),,[Surface 19], []

[openstudio.model.Surface] <-1> Intersection of 'Surface ...
(more)
2023-02-10 22:14:10 -0500 answered a question OpenStudio 3.4.0 Python subsurface intersect/match

This is getting to be pretty long so I want to close this off by stating that macumber had suggested intersection does n

2023-02-06 19:25:03 -0500 commented question OpenStudio 3.4.0 Python subsurface intersect/match

Just to close the loop, I did this with Trace, Info, Debug, Warn, Error and Fatal now - some result in no messages at al

2023-02-06 08:03:35 -0500 commented answer OpenStudio 3.4.0 Python subsurface intersect/match

I was also looking for 2.9.X-LTS, following your links above. computeIntersection in Surface.cpp and intersectSurfaces i

2023-02-06 07:52:51 -0500 edited question OpenStudio 3.4.0 Python subsurface intersect/match

OpenStudio 3.4.0 Python subsurface intersect/match I am working on a geometry modeler for OpenStudio. I am doing this in

2023-02-06 07:30:23 -0500 commented question OpenStudio 3.4.0 Python subsurface intersect/match

all three versions are treated identically in my FreeCAD to OpenStudio conversion, and all run to "completion" without e

2023-02-06 07:25:51 -0500 commented question OpenStudio 3.4.0 Python subsurface intersect/match

Thank you Julian Marrec. Last thing first, I agree 100% with your caution, and I am only using the 2.9.1 hack so I can k

2023-02-05 20:26:48 -0500 commented answer OpenStudio 3.4.0 Python subsurface intersect/match

Interesting, thanks to your link I was able to convert the Ruby into a Python and get some info out of it, sort of. Now,

2023-02-05 19:30:13 -0500 commented answer OpenStudio 3.4.0 Python subsurface intersect/match

Also, one other reason I am hoping to make progress with FreeCAD is to reduce some of the labor, such as having to gener

2023-02-05 19:25:43 -0500 commented answer OpenStudio 3.4.0 Python subsurface intersect/match

Thank you macumber. it seems that intersectSurfaces calls computeIntersection, and that has the following parts: if (!t

2023-02-03 08:54:07 -0500 asked a question OpenStudio 3.4.0 Python subsurface intersect/match

OpenStudio 3.4.0 Python subsurface intersect/match I am working on a geometry modeler for OpenStudio. I am doing this in

2022-10-31 11:38:27 -0500 received badge  Self-Learner (source)
2022-10-29 10:38:48 -0500 marked best answer openstudio python bindings

I am dabbling with using the FreeCAD BIM Workbench to generate geometry for the .OSM file. FreeCAD is very powerful and has built-in Python capability. At this point, I can generate some simple spaces. However, I'd like to check adjacent surfaces and am running into a problem transferring the boost::optional approach from Ruby to Python. In Ruby, I would do the following (more or less, I am not in Ruby right now):

model.getSurfaces().each do |surface|
  adjacent_surface = surface.adjacentSurface()
  unless adjacent_surface.empty? then
    puts surface.name
    puts adjacent_surface.get.name
  end
end

With this, I would obtain just the names (simple strings) of surface and adjacent_surface, as desired.

In Python, I am trying the following:

for surface in model.getSurfaces():
  adjacent_surface = surface.adjacentSurface()
  if adjacent_surface is not None:
    print(surface.name)
    print(adjacent_surface.get.name)

But the "get.name" part in the last line results in this error: AttributeError: 'function' object has no attribute 'name'. And if I use just "get", the following is an example output:

<bound method IdfObject.name of <openstudio.openstudiomodelgeometry.Surface; proxy of <Swig Object of type 'std::vector< openstudio::model::Surface >::value_type *' at 0x7fea7ab0f870> >>

<bound method OptionalSurface.get of <openstudio.openstudiomodelgeometry.OptionalSurface; proxy of <Swig Object of type 'openstudio::model::OptionalSurface *' at 0x7fea66d46630> >>

That is to say, not even non-boost::optional surface shows the name. Both it and boost::optional adjacent_surface just show what appears to be a type or class specification. How can I get the simple name strings here?

2022-10-29 10:38:30 -0500 answered a question openstudio python bindings

OK, so it was late last night and I was tired. A little more digging this morning led me to try the following: for surf

2022-10-29 10:38:30 -0500 received badge  Rapid Responder (source)
2022-10-29 00:58:14 -0500 commented question openstudio python bindings

Actually, using surface.name() rather than surface.name at least gets me surface name. However, using adjacent_surface.g

2022-10-29 00:47:41 -0500 asked a question openstudio python bindings

openstudio python bindings I am dabbling with using the FreeCAD BIM Workbench to generate geometry for the .OSM file. Fr

2022-09-25 12:03:34 -0500 commented answer Create Baseline Building for ASHRAE 90.1-2013 PRM

Ah, I think I see. As of 90.1-2016, the baseline building will always be the same, and instead the Building Performance

2022-09-25 11:49:29 -0500 answered a question Hourly reports in EnergyPlus output file

You should be able to locate files "eplusout.rdd" and "eplusout.mdd" somewhere in the run folder for your IDF file. In

2022-09-25 11:49:29 -0500 received badge  Rapid Responder (source)
2022-09-23 17:31:09 -0500 commented answer Create Baseline Building for ASHRAE 90.1-2013 PRM

OK, so I simply did the following, which does seem to run to completion, albeit with fairly low energy usage. standard

2022-09-21 10:39:09 -0500 marked best answer Create Baseline Building for ASHRAE 90.1-2013 PRM

Has anyone had any luck in using the Create Baseline Building measure? I am trying to run it on a random (proposed) building and am receiving hundreds of Warnings about all kinds of things not being found, though the measure does run to completion. Most warnings are of the following type:

Warning: Space type properties lookup failed: {"template"=>"90.1-2013","building_type"=>nil,"space_type"=>nil}

I am (randomly) selecting a SmallOffice in climate zone 2A when the measure first starts up, just to select something. When the measure is done, new AirLoopHVACs have appeared, and some Schedules have been added, but constructions and loads appear to be untouched?

I suspect the proposed building has to be set up in a particular way for this measure to work properly? I was trying to find openstudio-standards documentation to find out what that set-up might need to be, but no luck thus far.

2022-09-21 10:39:03 -0500 commented answer Create Baseline Building for ASHRAE 90.1-2013 PRM

Happy to report that I was able to make it run now, adjusting all those measure tags, not just in Space Types, but also