I've been following CityEngine tutorial 12 on scripted report exporting, and I'm trying to adapt this to my own project, however am running into some issues. This is probably something very simple and I'm hoping you can help me!
I'm trying to report floor areas for a number of buildings and have followed tutorial 11 on reporting.
The report on floor areas comes through as expected in the reports panel, when lots are selected.
Following tutorial 12, I've added the InstanceReport attribute into the rule that creates the floors, next to where the areas are reported:
I'm running the exportInstances python script, but get an 'IndexError: index out of range: 1' error:
In the log I also have this error - I'm wondering if this means the floors are being ignored because they are a 2d plane, with no thickness? Or am I misinterpreting..
I've attached the rule file for the lot, the python script, and imported script for reporting. Essentially, I'm trying to report the GFA.Office, GFA.Residential and Land_Parcel value, as shown in the reports panel, split by instance, to an csv file.
Any pointers you have much appreciated - please let me know if you need any more info.
To follow up, I've found that there is a more generic script at the end of tutorial 11:
This works for my area figures, but I get an error if there are any report values containing strings (eg the parcel name):
TypeError: unsupported operand type(s) for +: 'int' and 'str'
Any ideas on how to adapt this script to handle strings, as well as numbers?
In case anyone needs to refer back to this in future, I just needed to change the script to account for a string rather than integer for my Parcel attribute, as that contained letters (duh!)