openergy / opyplus

A package to work with EnergyPlus in python
Mozilla Public License 2.0
38 stars 13 forks source link

add_field >101 for IDD list description error #15

Closed Lefort-Antoine closed 5 years ago

Lefort-Antoine commented 7 years ago

Due to error in .idd description object (BranchList, NodeList, ..) Add optional argument : ' byref=False' in add_field() function (idf.py)

abydash commented 7 years ago

image

I still get the error after adding the optional argument

Lefort-Antoine commented 5 years ago

the synthaxe to add field to an object is object.add_field(value) `import oplus as op

create an idf

idf = op.Idf("")`

add an buildingsurface object

bsd_o = idf.add("""BuildingSurface:Detailed, surface_example, ! - Name floor, ! - Surface Type , ! - Construction Name , ! - Zone Name zone, ! - Outside Boundary Condition , ! - Outside Boundary Condition Object nosun, ! - Sun Exposure nowind, ! - Wind Exposure , ! - View Factor to Ground 2, ! - Number of Vertices -18.436949171, 21.6350748574, 11.4;""")

you can also get it with

bsd_o = idf["BuildingSurface:Detailed"].one()

or

bsd_o = idf["BuildingSurface:Detailed"].one(lambda x: x['Name'] == "surface_example")

add a field

bsd_o.add_field(2) '