diff --git a/src/ifcopenshell-python/ifcopenshell/entity_instance.py b/src/ifcopenshell-python/ifcopenshell/entity_instance.py index a9d5b81a06..9f1434717d 100644 --- a/src/ifcopenshell-python/ifcopenshell/entity_instance.py +++ b/src/ifcopenshell-python/ifcopenshell/entity_instance.py @@ -54,7 +54,7 @@ _method_dict = {} for nm in ifcopenshell_wrapper.schema_names(): schema = ifcopenshell_wrapper.schema_by_name(nm) for decl in schema.declarations(): - if isinstance(decl, ifcopenshell_wrapper.entity): + if hasattr(decl, "argument_types"): fq_name = ".".join((nm, decl.name())) # get type strings as reported by IfcOpenShell C++ diff --git a/src/ifcwrap/IfcParseWrapper.i b/src/ifcwrap/IfcParseWrapper.i index 51a3badb3d..c63b931c7e 100644 --- a/src/ifcwrap/IfcParseWrapper.i +++ b/src/ifcwrap/IfcParseWrapper.i @@ -610,6 +610,16 @@ static IfcUtil::ArgumentType helper_fn_attribute_type(const IfcUtil::IfcBaseClas def __repr__(self): return "" % (self.name(), self.declared_type()) %} + std::vector argument_types() { + std::vector r; + auto at = IfcUtil::Argument_UNKNOWN; + auto pt = $self->declared_type(); + if (pt) { + at = IfcUtil::from_parameter_type(pt); + } + r.push_back(IfcUtil::ArgumentTypeToString(at)); + return r; + } } %extend IfcParse::select_type { @@ -624,6 +634,11 @@ static IfcUtil::ArgumentType helper_fn_attribute_type(const IfcUtil::IfcBaseClas def __repr__(self): return "" % (self.name(), ", ".join(self.enumeration_items())) %} + std::vector argument_types() { + std::vector r; + r.push_back(IfcUtil::ArgumentTypeToString(IfcUtil::Argument_STRING)); + return r; + } } %extend IfcParse::attribute {