Fix example script for printing out properties. See #1145.

This commit is contained in:
Dion Moult
2020-12-04 10:59:59 +11:00
parent 9a20de914b
commit 06685f9768
@@ -158,9 +158,12 @@ if selection:
#get the IfcProduct that is stored in the global variable 'selection'
obj = selection
for relDefinesByProperties in obj.IsDefinedBy:
if not relDefinesByProperties.is_a("IfcRelDefinesByProperties"):
continue
print("[{0}]".format(relDefinesByProperties.RelatingPropertyDefinition.Name))
for prop in relDefinesByProperties.RelatingPropertyDefinition.HasProperties:
print ("{:<20} :{}".format(prop.Name,prop.NominalValue.wrappedValue))
if relDefinesByProperties.RelatingPropertyDefinition.is_a("IfcPropertySet"):
for prop in relDefinesByProperties.RelatingPropertyDefinition.HasProperties:
print ("{:<20} :{}".format(prop.Name,prop.NominalValue.wrappedValue))
print ("\\n")
""".lstrip()
),