I'm having difficulty reading an Element Template from my .dgnlib. In the .dgnlib I have:
And when I try FindTemplateNodeByPath(), the result is always NULL and Invalid. I'm using the current DGN file as the DgnFileR value - is that incorrect because the template has not been used and is only in the .dgnlib?
// try to use a template XDataTreeOwner* owner = XDataTreeManager::GetDgnXDataTreeOwner(*ISessionMgr::GetActiveDgnFile()); ElementTemplateNodePtr parentGroup = ElementTemplateUtils::FindTemplateNodeByPath(L"Common Line Types", *ISessionMgr::GetActiveDgnFile()); wprintf(L"parentGroup.IsNull() %s\n", parentGroup.IsNull() ? L"TRUE" : L"FALSE"); wprintf(L"parentGroup.IsValid() %s\n", parentGroup.IsValid() ? L"TRUE" : L"FALSE"); ElementTemplateNodePtr elementTemplate = ElementTemplateUtils::FindTemplateNodeByPath(L"Common Line Types\\Column Line", *ISessionMgr::GetActiveDgnFile()); wprintf(L"elementTemplate.IsNull() %s\n", elementTemplate.IsNull() ? L"TRUE" : L"FALSE"); wprintf(L"elementTemplate.IsValid() %s\n", elementTemplate.IsValid() ? L"TRUE" : L"FALSE");
Bruce