Hi, I’m stuck in the CE Python stuff. I need to create a semi colon separated list in a text file summed by the start shape.
So exactly like in Tutorial 12, I’m not getting any errors anymore on export, but as soon as I replace the names from the tutorial 12 to my own names in the reports, it’s not writing the text file any more. As soon as I misspell something in my report, it fails, so I guess I’m getting my strings correct. I also did changed the report names in the tutorial 12, to match my names, and as soon as I do that, it runs, but it don’t write the file.
Anyone knows what going on? Thanks
I’ve changed the way reports where created in CE, and I got it to work, more or less.
How do I access the sum in the report, right now I’m only getting the average?
In the code above, there is a mistake in the output filepath definition. ce.toFSPath() needs a valid folder name. I think you meant:
file = ce.toFSPath("assets")+"/instanceMapHaps.txt"
Once that is changed, your script seems to work.
As for the reported values, every shape in the scene reports its own value, and this is what is written to the output file. No averages or mins are calculated. If you run the script on three buildings, your output file will have three rows (plus the header), one row for each building. For each building, its stats (i.e. usage, GFA, footprint area, number of floors) are written.
To get the sum, you could keep a running sum of the desired report similar to how the running count is kept with gInstanceCount.