Using eppy to retrieve idf objects fieldnames
Hello, I am a eppy beginner and am trying to replace certain parameters with @@labels@@ in order to prepare an idf file for jeplus. The first step would be to retrieve the Z coordinates for walls and ceilings' top vertexes. Having written the code:
**surfaces = idf1.idfobjects['BUILDINGSURFACE:DETAILED']**
**surf_names = [surface.Name for surface in surfaces]**
geometry = idf1.idfobjects['buildingsurface:detailed'.upper()]
idf_ceiling = 'RoofCeiling'
idf_wall = 'Wall' idf_floor = 'Floor'
for s in surfaces:
if sub in s:
print s; #print geometry[s].area
returns the error:
AttributeError: 'Idf_MSequence' object has no attribute 'fieldnames'
Comments
You are trying to get the fieldnames of a sequence. You want to get the fieldnames of an object. The snippet of code you've posted doesn't explain why you are looping over surf_names or what is in surf_names. You need to loop over each of the objects in the geometry sequence and test each of those for a match.
Apologies, I had only copied part of the code. See if my edit makes sense now