File tree Expand file tree Collapse file tree
src/ifcopenshell-python/ifcopenshell Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,10 +43,11 @@ class entity_instance(object):
4343 def __init__ (self , e ):
4444 super (entity_instance , self ).__setattr__ ('wrapped_data' , e )
4545 def __getattr__ (self , name ):
46- try : return entity_instance .wrap_value (self .wrapped_data .get_argument (self .wrapped_data .get_argument_index (name )))
47- except :
48- try : return entity_instance .wrap_value (self .wrapped_data .get_inverse (name ))
49- except : raise AttributeError ("entity instance of type '%s' has no attribute '%s'" % (self .wrapped_data .is_a (), name ))
46+ if name in self .wrapped_data .get_attribute_names ():
47+ return entity_instance .wrap_value (self .wrapped_data .get_argument (self .wrapped_data .get_argument_index (name )))
48+ elif name in self .wrapped_data .get_inverse_attribute_names ():
49+ return entity_instance .wrap_value (self .wrapped_data .get_inverse (name ))
50+ else : raise AttributeError ("entity instance of type '%s' has no attribute '%s'" % (self .wrapped_data .is_a (), name ))
5051 @staticmethod
5152 def map_value (v ):
5253 if isinstance (v , entity_instance ): return v .wrapped_data
You can’t perform that action at this time.
0 commit comments