mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 12:12:15 +00:00
Extend Python's dir() function on entity instances with attribute and inverse attribute names of entities
This commit is contained in:
@@ -216,3 +216,19 @@ bool IfcParse::IfcLateBoundEntity::is_valid() {
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
|
||||
std::vector<std::string> IfcParse::IfcLateBoundEntity::getAttributeNames() const {
|
||||
std::vector<std::string> return_value;
|
||||
return_value.reserve(getArgumentCount());
|
||||
for (unsigned i = 0; i < getArgumentCount(); ++i) {
|
||||
return_value.push_back(getArgumentName(i));
|
||||
}
|
||||
return return_value;
|
||||
}
|
||||
|
||||
std::vector<std::string> IfcParse::IfcLateBoundEntity::getInverseAttributeNames() const {
|
||||
std::vector<std::string> return_value;
|
||||
std::set<std::string> values = IfcSchema::Type::GetInverseAttributeNames(_type);
|
||||
std::copy(values.begin(), values.end(), std::back_inserter(return_value));
|
||||
return return_value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user