mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
Fix unnecessary error message when getting psets.
This commit is contained in:
@@ -3,21 +3,15 @@ import ifcopenshell
|
|||||||
|
|
||||||
def get_psets(element):
|
def get_psets(element):
|
||||||
psets = {}
|
psets = {}
|
||||||
try:
|
if element.is_a("IfcTypeObject"):
|
||||||
if element.is_a("IfcTypeObject"):
|
if element.HasPropertySets:
|
||||||
if element.HasPropertySets:
|
for definition in element.HasPropertySets:
|
||||||
for definition in element.HasPropertySets:
|
psets[definition.Name] = get_property_definition(definition)
|
||||||
psets[definition.Name] = get_property_definition(definition)
|
elif hasattr(element, "IsDefinedBy"):
|
||||||
else:
|
for relationship in element.IsDefinedBy:
|
||||||
for relationship in element.IsDefinedBy:
|
if relationship.is_a("IfcRelDefinesByProperties"):
|
||||||
if relationship.is_a("IfcRelDefinesByProperties"):
|
definition = relationship.RelatingPropertyDefinition
|
||||||
definition = relationship.RelatingPropertyDefinition
|
psets[definition.Name] = get_property_definition(definition)
|
||||||
psets[definition.Name] = get_property_definition(definition)
|
|
||||||
except Exception as e:
|
|
||||||
import traceback
|
|
||||||
|
|
||||||
print("failed to load properties: {}".format(e))
|
|
||||||
traceback.print_exc()
|
|
||||||
return psets
|
return psets
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user