[v8i MDL] api for import element templates via xml

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,

Parents Reply Children
  • 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