File tree Expand file tree Collapse file tree
ifcopenshell-python/ifcopenshell Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,8 +120,8 @@ def __hash__(self):
120120 def __dir__ (self ):
121121 return sorted (set (itertools .chain (
122122 dir (type (self )),
123- self .wrapped_data .get_attribute_names (),
124- self .wrapped_data .get_inverse_attribute_names ()
123+ map ( str , self .wrapped_data .get_attribute_names () ),
124+ map ( str , self .wrapped_data .get_inverse_attribute_names () )
125125 )))
126126
127127 def get_info (self , include_identifier = True , recursive = False ):
Original file line number Diff line number Diff line change @@ -109,9 +109,26 @@ private:
109109
110110 // id() is defined on IfcBaseEntity and not on IfcBaseClass, in order
111111 // to expose it to the Python wrapper it is simply duplicated here.
112+ // Same applies to the two methods reimplemented below.
112113 int id () const {
113114 return $self->entity ->id ();
114115 }
116+
117+ std::vector<std::string> getAttributeNames () const {
118+ if (IfcSchema::Type::IsSimple ($self->type ())) {
119+ return std::vector<std::string>(1 , " wrappedValue" );
120+ }
121+ IfcUtil::IfcBaseEntity* self_ = (IfcUtil::IfcBaseEntity*) self;
122+ return self_->getAttributeNames ();
123+ }
124+
125+ std::vector<std::string> getInverseAttributeNames () const {
126+ if (IfcSchema::Type::IsSimple ($self->type ())) {
127+ return std::vector<std::string>(0 );
128+ }
129+ IfcUtil::IfcBaseEntity* self_ = (IfcUtil::IfcBaseEntity*) self;
130+ return self_->getInverseAttributeNames ();
131+ }
115132
116133 bool is_a (const std::string& s) {
117134 return self->is (IfcSchema::Type::FromString (boost::to_upper_copy (s)));
You can’t perform that action at this time.
0 commit comments