mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
#1912 apply also on types
This commit is contained in:
@@ -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++
|
||||
|
||||
@@ -610,6 +610,16 @@ static IfcUtil::ArgumentType helper_fn_attribute_type(const IfcUtil::IfcBaseClas
|
||||
def __repr__(self):
|
||||
return "<type %s: %r>" % (self.name(), self.declared_type())
|
||||
%}
|
||||
std::vector<std::string> argument_types() {
|
||||
std::vector<std::string> 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 "<enumeration %s: (%s)>" % (self.name(), ", ".join(self.enumeration_items()))
|
||||
%}
|
||||
std::vector<std::string> argument_types() {
|
||||
std::vector<std::string> r;
|
||||
r.push_back(IfcUtil::ArgumentTypeToString(IfcUtil::Argument_STRING));
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
%extend IfcParse::attribute {
|
||||
|
||||
Reference in New Issue
Block a user