Ets_Tool_Open()
Note: Requires OPNET Development Kit
Abstract
Opens and installs an editor.
Syntax
Ets_Tool_Open (editor_type_name, model_name)
| Argument | Type | Description |
|---|---|---|
editor_type_name |
const char * |
Name of editor to open (see Details) |
model_name |
const char * |
A valid model name, empty, or OPC_NIL. |
Return Type
EtsT_Compcode
EtsC_Compcode_Failure if either name is invalid; EtsC_Compcode_Success otherwise.
Header
ets_api_tool.h
Details
This function opens an editor and makes it the current one (that is, it makes the editor window topmost and active). The editor is opened with the named model or, if the model name is OPC_NIL or empty, with a new, unsaved model. If the specified editor and model combination is already open, that editor is made active.
If either the editor or model name doesn't exist, nothing is opened and the function returns EtsC_Compcode_Failure.
The editor_type_name argument must be one of the editor names defined in an ETS configuration file (such as <reldir>\sys\configs\modeler.ets). Valid editor names include "System" and "project".
When used as follows, this function incorporates the functionality of the deprecated function Ets_Model_New_Tool_Set_By_Name():
- Call
Ets_Tool_Open()with an empty string for themodel_nameargument. - Call Ets_Pj_Current_Scenario_Component_Import() with the
file_typeEtsC_Pj_Scenario_Component_Network.
For example:
/* Open an empty Project Editor */
Ets_Tool_Open ("project", OPC_NIL);
/* Import the desired network model. */
Ets_Pj_Current_Scenario_Component_Import (EtsC_Pj_Scenario_Component_Network,
<filename>);