very simple gbxml import is failing with the following error message. “1. Solution exception:‘OptionalString’ object has no attribute ‘upper’”
The error happens when it tries to convert the construction name into upper case. Line 308 of the script.
if vers < 27: constructionCollection[str(c.name().upper())] = getHBConstruction(c, materials)
I added a print statement to check c.name() content and the type and I got back the following:
The model is imported from C:\Users\vel84628\Documents\test\TestOPexported.xml
> 2013 External Window
> <type ‘OptionalString’>
Runtime error (MissingMemberException): ‘OptionalString’ object has no attribute ‘upper’
Traceback:
line 310, in script
This means it finds the construction “2013 External Window”, and then it is not able to convert it to upper case because it is an OptionalString type instead of String…
So I changed the line 308 to:
constructionCollection[str(c.name()).upper()] = getHBConstruction(c, materials)
in this way .upper is applied to str(c.name()) instead of c.name(), which might be the reason the str() funtion is there in the first place. So this worked, but then it keeps finding the same problem throughout the script and other related scripts.
Any ideas on how to solve this? Am I missing something or is this a bug?
TestOPexported.xml (121.5 KB)
simpleimport_Model_from_gbXML.gh (463.0 KB)
I exported the gbxml from Openstudio.
Im using openstudio 2.5, HB and LB where updated on last release. Rhino 5.