Core: Add a possibility to extract active object based on extension

This commit is contained in:
tetektoza
2025-06-22 17:41:22 +02:00
committed by Benjamin Nauck
parent 661d2052b7
commit 908941f2d1
3 changed files with 20 additions and 0 deletions

View File

@@ -197,3 +197,15 @@ void ActiveObjectList::objectDeleted(const ViewProviderDocumentObject &vp)
}
}
}
App::DocumentObject* ActiveObjectList::getObjectWithExtension(const Base::Type extensionTypeId) const
{
for (const auto& pair : _ObjectMap) {
App::DocumentObject* obj = getObject(pair.second, true);
if (obj && obj->hasExtension(extensionTypeId)) {
return obj;
}
}
return nullptr;
}