File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
ifcopenshell-python/ifcopenshell Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def set_derived_atribute(*args):
5454for nm in ifcopenshell_wrapper .schema_names ():
5555 schema = ifcopenshell_wrapper .schema_by_name (nm )
5656 for decl in schema .declarations ():
57- if isinstance (decl , ifcopenshell_wrapper . entity ):
57+ if hasattr (decl , "argument_types" ):
5858 fq_name = "." .join ((nm , decl .name ()))
5959
6060 # get type strings as reported by IfcOpenShell C++
Original file line number Diff line number Diff line change @@ -610,6 +610,16 @@ static IfcUtil::ArgumentType helper_fn_attribute_type(const IfcUtil::IfcBaseClas
610610 def __repr__ (self):
611611 return " <type %s: %r>" % (self.name (), self.declared_type ())
612612 %}
613+ std::vector<std::string> argument_types () {
614+ std::vector<std::string> r;
615+ auto at = IfcUtil::Argument_UNKNOWN;
616+ auto pt = $self->declared_type ();
617+ if (pt) {
618+ at = IfcUtil::from_parameter_type (pt);
619+ }
620+ r.push_back (IfcUtil::ArgumentTypeToString (at));
621+ return r;
622+ }
613623}
614624
615625%extend IfcParse::select_type {
@@ -624,6 +634,11 @@ static IfcUtil::ArgumentType helper_fn_attribute_type(const IfcUtil::IfcBaseClas
624634 def __repr__ (self):
625635 return " <enumeration %s: (%s)>" % (self.name (), " , " .join (self.enumeration_items ()))
626636 %}
637+ std::vector<std::string> argument_types () {
638+ std::vector<std::string> r;
639+ r.push_back (IfcUtil::ArgumentTypeToString (IfcUtil::Argument_STRING));
640+ return r;
641+ }
627642}
628643
629644%extend IfcParse::attribute {
You can’t perform that action at this time.
0 commit comments