Skip to content

Commit

Permalink
Arch: Fixed issue with empty properties in IFC import
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Apr 25, 2019
1 parent fbc5427 commit e580864
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/Mod/Arch/importIFC.py
Expand Up @@ -973,17 +973,18 @@ def insert(filename,docname,skip=[],only=[],root=None):
if six.PY2:
pname = pname.encode("utf8")
if e.is_a("IfcPropertySingleValue"):
ptype = e.NominalValue.is_a()
if ptype in ['IfcLabel','IfcText','IfcIdentifier','IfcDescriptiveMeasure']:
pvalue = e.NominalValue.wrappedValue
if six.PY2:
pvalue = pvalue.encode("utf8")
else:
pvalue = str(e.NominalValue.wrappedValue)
if hasattr(e.NominalValue,'Unit'):
if e.NominalValue.Unit:
pvalue += e.NominalValue.Unit
d[pname+";;"+psetname] = ptype+";;"+pvalue
if e.NominalValue:
ptype = e.NominalValue.is_a()
if ptype in ['IfcLabel','IfcText','IfcIdentifier','IfcDescriptiveMeasure']:
pvalue = e.NominalValue.wrappedValue
if six.PY2:
pvalue = pvalue.encode("utf8")
else:
pvalue = str(e.NominalValue.wrappedValue)
if hasattr(e.NominalValue,'Unit'):
if e.NominalValue.Unit:
pvalue += e.NominalValue.Unit
d[pname+";;"+psetname] = ptype+";;"+pvalue
#print("adding property: ",pname,ptype,pvalue," pset ",psetname)
obj.IfcProperties = d

Expand Down

0 comments on commit e580864

Please sign in to comment.