Arch - IFC : Handle case where NominalValue is None
This commit is contained in:
parent
a3209e1aee
commit
604fc320cf
|
@ -631,14 +631,15 @@ def insert(filename,docname,skip=[],only=[],root=None):
|
||||||
for p in properties[pid][c]:
|
for p in properties[pid][c]:
|
||||||
l = ifcfile[p]
|
l = ifcfile[p]
|
||||||
if l.is_a("IfcPropertySingleValue"):
|
if l.is_a("IfcPropertySingleValue"):
|
||||||
if IMPORT_PROPERTIES :
|
|
||||||
if DEBUG :
|
if DEBUG :
|
||||||
print("property name",l.Name,type(l.Name))
|
print("property name",l.Name,type(l.Name))
|
||||||
|
ifc_spreadsheet.set(str('A'+str(n)), catname.encode("utf8"))
|
||||||
|
ifc_spreadsheet.set(str('B'+str(n)), l.Name.encode("utf8"))
|
||||||
|
if l.NominalValue :
|
||||||
|
if DEBUG :
|
||||||
print("property NominalValue",l.NominalValue.is_a(),type(l.NominalValue.is_a()))
|
print("property NominalValue",l.NominalValue.is_a(),type(l.NominalValue.is_a()))
|
||||||
print("property NominalValue.wrappedValue",l.NominalValue.wrappedValue,type(l.NominalValue.wrappedValue))
|
print("property NominalValue.wrappedValue",l.NominalValue.wrappedValue,type(l.NominalValue.wrappedValue))
|
||||||
#print("l.NominalValue.Unit",l.NominalValue.Unit,type(l.NominalValue.Unit))
|
#print("l.NominalValue.Unit",l.NominalValue.Unit,type(l.NominalValue.Unit))
|
||||||
ifc_spreadsheet.set(str('A'+str(n)), catname.encode("utf8"))
|
|
||||||
ifc_spreadsheet.set(str('B'+str(n)), l.Name.encode("utf8"))
|
|
||||||
ifc_spreadsheet.set(str('C'+str(n)), l.NominalValue.is_a())
|
ifc_spreadsheet.set(str('C'+str(n)), l.NominalValue.is_a())
|
||||||
if l.NominalValue.is_a() in ['IfcLabel','IfcText','IfcIdentifier','IfcDescriptiveMeasure']:
|
if l.NominalValue.is_a() in ['IfcLabel','IfcText','IfcIdentifier','IfcDescriptiveMeasure']:
|
||||||
ifc_spreadsheet.set(str('D'+str(n)), "'" + str(l.NominalValue.wrappedValue.encode("utf8")))
|
ifc_spreadsheet.set(str('D'+str(n)), "'" + str(l.NominalValue.wrappedValue.encode("utf8")))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user