DG Kernel Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
Overview of the software
What is new
Licensing
Collapse ModelsModels
Expand DG Kernel ComponentsDG Kernel Components
Expand API ReferenceAPI Reference
Expand Samples and TutorialsSamples and Tutorials
Expand GraphicsGraphics
Expand Math ObjectsMath Objects
Expand DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation LinksHome Page > Models > Persistence Search Documentation


Model Persistence

Models can be loaded or saved by DG Kernel component programmatically at runtime. To save use either Save or SaveAs methods of the component or IModel_DG.Save*() methods.

To load either change the ModelPath property to a new location or use IModel_DG.Load*().. 

The required format in the above operations is determined by the file extension

IModelEx also provides methods for saving and loading the model to and from a memory buffer bypassing the file system, which allows embedding DG Kernel models in application documents and other tasks.

Converter

Apart from Save As functionality of DGKernel, the cglm.exe in the installation folder can be used via command line to convert between glm and mdg formats. It is recommended to conveert all .glm models to .mdg as .glm format is considered outdated.

Usage:

To convert a single .glm file: cglm.exe D:\Models\Glm\TheModel.glm D:\Models\Glm\TheModel.mdg

To convert all .glm files in a directory, including subfolders: cglm.exe D:\Models\Glm\*.glm -r D:\Models\Mdg\

In the above command the last parameter is the target folder, which will keep structure of the source directory

Command: cglm.exe D:\Models\Glm\*.glm -r will place the new .mdg files next to its source .glm file

cglm.exe does not delete or move any existing files

See Also: Models