Scripted Export Errors

808
2
08-08-2021 09:29 AM
MattOlsen
New Contributor III

Hi everyone, 

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.

MattOlsen_0-1628438432423.png

The report on floor areas comes through as expected in the reports panel, when lots are selected.

MattOlsen_1-1628438501875.png

Following tutorial 12, I've added the InstanceReport attribute into the rule that creates the floors, next to where the areas are reported:

MattOlsen_2-1628438590431.png

 

I'm running the exportInstances python script, but get an 'IndexError: index out of range: 1' error:

MattOlsen_5-1628439394904.png

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..

MattOlsen_4-1628438733416.png

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.

 

 

 

 

 

 

 

 

 

 

 

 

 

0 Kudos
2 Replies
MattOlsen
New Contributor III

To follow up, I've found that there is a more generic script at the end of tutorial 11:MattOlsen_0-1628581153191.png

 

This works for my area figures, but I get an error if there are any report values containing strings (eg the parcel name):

MattOlsen_1-1628581236693.png

 

TypeError: unsupported operand type(s) for +: 'int' and 'str'

Any ideas on how to adapt this script to handle strings, as well as numbers?

MattOlsen
New Contributor III

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!)

0 Kudos