Hi,
As you may or may not know, you can manually import and export the element templates as an xml file with the element template dialog.
Is there a way to import those xml files via some mdl api call (or any other c++, it doesn't matter)? I recorded a vba macro of the import and export, but sadly no method calls were saved.
best regards,
The file parameter (libFileObj) of mdlElementTemplate functions (mdlElementTemplate_getExistingTemplateInFile) are typically used in the context of dgnlib files: e.g. DgnFileP activeFile = (DgnFileP)ISessionMgr::GetActiveDgnFile ().
Though I was unable to promptly locate a direct native or managed XML import/export path in the existing public MDL C or C++ API, if it is of any help still here are a couple related MicroStation key-ins that may be of use:
To Export all dgnlib data from the active file as XML, key-in
CUSTOMIZE EXPORT XML c:\Project\ElementTemplates.xml
To Export specific dgnlib data from the active file as XML, key-in
CUSTOMIZE EXPORT DATATREEXML [ToolBoxes|Tasks|MainTasks|Menus|ContextMenus|ViewPopupMenus|TentativePopupMenus|ElementTemplates]
To Import XML data into the active dgnlib, key-in
CUSTOMIZE IMPORT XML c:\Project\ElementTemplates.xml
HTH,Bob
Answer Verified By: Harmen gro�e Deters
mdlElementTemplate_getExistingTemplateInFile is the only candidate I can see. The documentation doesn't tell us whether file is a DGN file or an XML file.
Regards, Jon Summers LA Solutions