Customization > Automation Interface > Functions > For User Interface > Functions for Models > OpenModel2 function (automation interface)
OpenModel2 function (automation interface)
Syntax:
OpenModel2("<name>","<directory>")
Where:
<name> is a string that specifies the name of the model to open.
<directory> is a string that specifies the path of the model to open, as returned through the Model's Directory attribute.
OpenModel2 opens a model using its Name and Directory attributes. The function returns a Boolean value to indicate success or failure.
When you specify the directory you must use the value of the Model's Directory attribute as returned through the automation interface, because it is returned as a short path.
Examples
In this example, Modeler opens the Filling Station model, identified by its directory.
Call Studio.
OpenModel2 ("Filling Station","\\MyComputer\ModelerATF\Examples\07711B~1\0\")
Was this helpful?