Option 1: Python, using eppy:
In [1]:
import eppy.EPlusInterfaceFunctions.parse_idd as parse_idd
iddfile = "/Applications/EnergyPlus-8-6-0/Energy+.idd"
IDF.setiddname(iddfile)
x = parse_idd.extractidddata(iddfile)
useful = x[2]
The most useful (IMHO) is the second element of the 4-tuple x
That's a list of each idd object, each idd object being a list of dict where the first element (index 0) is the object itself, and the following are each field.
Example:
In [2]: useful[6]
Out[2]:
[{'format': ['singleLine'],
'group': 'Simulation Parameters',
'idfobj': 'SurfaceConvectionAlgorithm:Inside',
'memo': ['Default indoor surface heat transfer convection algorithm to be used for all zones'],
'unique-object': ['']},
{'default': ['TARP'],
'field': ['Algorithm'],
'key': ['Simple', 'TARP', 'CeilingDiffuser', 'AdaptiveConvectionAlgorithm'],
'note': ['Simple = constant value natural convection (ASHRAE)',
'TARP = variable natural convection based on temperature difference (ASHRAE, Walton)',
'CeilingDiffuser = ACH-based forced and mixed convection correlations',
'for ceiling diffuser configuration with simple natural convection limit',
'AdaptiveConvectionAlgorithm = dynamic selection of convection models based on conditions'],
'type': ['choice']}]
Here's a way you would print each object and their fields (there's much more info) for the first few objects of the idd
In [3]:
for k in useful[2:5]:
print(k[0]['idfobj'])
for j in k[1:]:
print("---- {}".format(j['field'][0]))
Out[3]:
Version
---- Version Identifier
SimulationControl
---- Do Zone Sizing Calculation
---- Do System Sizing Calculation
---- Do Plant Sizing Calculation
---- Run Simulation for Sizing Periods
---- Run Simulation for Weather File Run Periods
---- Do HVAC Sizing Simulation for Sizing Periods
---- Maximum Number of HVAC Sizing Simulation Passes
Building
---- Name
---- North Axis
---- Terrain
---- Loads Convergence Tolerance Value
---- Temperature Convergence Tolerance Value
---- Solar Distribution
---- Maximum Number of Warmup Days
---- Minimum Number of Warmup Days
Option 2: Ruby, using OpenStudio
This will print each object and its field, as well as save it into a hash (key = idd object name, value = list of fields)
h = {}
factory = OpenStudio::IddFileAndFactoryWrapper.new("EnergyPlus".to_IddFileType)
factory.objects.each do |obj|
n = obj.numFields
l = []
puts obj.name.to_s
obj.nonextensibleFields.each do |field|
puts "---- #{field.name.to_s}"
l << field.name.to_s
end
if l.length < n
puts "ERROR, missing fields"
end
h[obj.name.to_s] = l
end
Of course you can access more info out of each field, for example field.properties.required
, field.properties.note
, field.properties.units.get
, etc, etc
Option 3: using the new JSON input dictionary (JDD), using either Python or Ruby
E+ 8.7 release is in preparation and will include a new "JDD" for JSON input Data Dictionary, the JSON equivalent of the IDD. Currently this is on a separate development branch, but here's the input_processor_refactor/idd/Energy+.jdd.in.
I'm gonna propose a Python and a Ruby version to parse this file, print the fields for each object as well as store a simple dict/hash where the key is the object type, and the value is a list of the fields for each object. Of course, there's way more information in the JDD, use it as you want.
3.a Python
import json
import urllib.request
jdd_url ...
(more)
C:\EnergyPlusV8-5-0\ExampleFiles\ExampleFiles-ObjectsLink.html
? (same for 8.4 and 8.6.)How about the
Energy+.idd
file? I would guess that there's a tool out there to parse it and write a list of the objects to file. Maybe eppy or the OpenStudio API?Thanks for the quick suggestions! Both would do the trick; the object link is easier. I'm also looking for the required inputs for each object so the *.idd covers that as well. But I can't choose an answer! ;)
@NickC I'll let you answer your own question since I don't know for sure that my suggestions will work, but please share how it goes!
@NickC you can try IddFileAndFactoryWrapper.