MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / getCustomAttributes

Method getCustomAttributes

src/App/DocumentObjectPyImp.cpp:938–953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

936}
937
938PyObject* DocumentObjectPy::getCustomAttributes(const char* attr) const
939{
940 // Must call PropertyContainerPy here, not ExtensionContainerPy
941 if (PyObject* py = PropertyContainerPy::getCustomAttributes(attr)) { // NOLINT
942 return py;
943 }
944
945 if (auto customProvider = Base::provideService<App::CustomAttributeProvider>()) {
946 auto opt = customProvider->getAttribute(getDocumentObjectPtr(), attr);
947 if (opt.has_value()) {
948 return opt.value();
949 }
950 }
951
952 return nullptr;
953}
954
955int DocumentObjectPy::setCustomAttributes(const char*, PyObject*)
956{

Callers

nothing calls this directly

Calls 3

has_valueMethod · 0.80
getAttributeMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected