mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 02:31:09 +00:00
adds get_info method for class #resolves #175
This commit is contained in:
@@ -85,3 +85,17 @@ class entity_instance(object):
|
|||||||
self.wrapped_data.get_attribute_names(),
|
self.wrapped_data.get_attribute_names(),
|
||||||
self.wrapped_data.get_inverse_attribute_names()
|
self.wrapped_data.get_inverse_attribute_names()
|
||||||
)))
|
)))
|
||||||
|
def get_info(self):
|
||||||
|
_info = {}
|
||||||
|
try:
|
||||||
|
_info["id"] = self.id()
|
||||||
|
_info["type"] = self.is_a()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
for i in range(len(self)):
|
||||||
|
try:
|
||||||
|
_info[self.attribute_name(i)] = self[i]
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
return _info
|
||||||
|
__dict__ = property(get_info)
|
||||||
Reference in New Issue
Block a user