mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 06:32:09 +00:00
Fix example script for printing out properties. See #1145.
This commit is contained in:
@@ -158,9 +158,12 @@ if selection:
|
|||||||
#get the IfcProduct that is stored in the global variable 'selection'
|
#get the IfcProduct that is stored in the global variable 'selection'
|
||||||
obj = selection
|
obj = selection
|
||||||
for relDefinesByProperties in obj.IsDefinedBy:
|
for relDefinesByProperties in obj.IsDefinedBy:
|
||||||
|
if not relDefinesByProperties.is_a("IfcRelDefinesByProperties"):
|
||||||
|
continue
|
||||||
print("[{0}]".format(relDefinesByProperties.RelatingPropertyDefinition.Name))
|
print("[{0}]".format(relDefinesByProperties.RelatingPropertyDefinition.Name))
|
||||||
for prop in relDefinesByProperties.RelatingPropertyDefinition.HasProperties:
|
if relDefinesByProperties.RelatingPropertyDefinition.is_a("IfcPropertySet"):
|
||||||
print ("{:<20} :{}".format(prop.Name,prop.NominalValue.wrappedValue))
|
for prop in relDefinesByProperties.RelatingPropertyDefinition.HasProperties:
|
||||||
|
print ("{:<20} :{}".format(prop.Name,prop.NominalValue.wrappedValue))
|
||||||
print ("\\n")
|
print ("\\n")
|
||||||
""".lstrip()
|
""".lstrip()
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user