参照案例写了一段获取模板的代码:
string strXmlXPath = @"Templates\Rail\Double Track -Ballasted"; string strLib = TemplateLibrary.GetDefaultTemplateLibraryPath(); TemplateLibrary templateLibrary = TemplateLibrary.Load(strLib); TemplateDefinition tempDef2 = templateLibrary.FindTemplateByPath(strXmlXPath);
但是,返现获取到的TemplateDefinition为Null。
请问有可能是什么原因呢?路径我检查了下应该是没问题的。
我搜索了一下FindTemplateByPath,能找到几个以前的帖子如下: