The i-model connection library provides APIs to connect Engine from host application.
More...
|
enum | Status { Success = 0,
Error
} |
| Imodel connection status. More...
|
|
enum | Reason {
NewEngine = 0,
GraphicalEngine,
NonGraphicalEngine,
ErrorDifferentRunningEngine,
ErrorNoResponseNewEngine,
ErrorNoResponseRunningEngine,
ErrorStartingNewEngine,
ErrorConnectionExist,
ErrorMismatchRequestedGraphicsMode,
ErrorEngineNotFound
} |
| Imodel connection Success/Error reasons. More...
|
|
The i-model connection library provides APIs to connect Engine from host application.
Overview of common uses for i-model IPC connection library with the following capabilities:
- To discover available Engines on the machine
- To connect/disconnect to the engine from host application
- To load user app in the engine
- To invoke user Key-in available in the app
typedef std::vector< ImodelCallback > CallbackList |
typedef void(* ImodelCallback)(wchar_t *) |
typedef IModelEngine* IModelEngineP |
Imodel connection Success/Error reasons.
Enumerator |
---|
NewEngine |
New instance of Engine.
|
GraphicalEngine |
Graphical Engine is running.
|
NonGraphicalEngine |
Non-Graphical Engine is running.
|
ErrorDifferentRunningEngine |
Error. Running engine is different from requested engine connect.
|
ErrorNoResponseNewEngine |
Error. New engine instance is not responding.
|
ErrorNoResponseRunningEngine |
Error. Running engine is not responsive.
|
ErrorStartingNewEngine |
Error starting new engine.
|
ErrorConnectionExist |
Error. Connection already exist. For new connection user need to disconnect earlier connection.
|
ErrorMismatchRequestedGraphicsMode |
Error. Requested UI mode is different from running engine.
|
ErrorEngineNotFound |
Error. Engine requested not found. Either Engine is not yet initialized or the Engine is not running with the same privilge as of 3rd party appllication.
|
Imodel connection status.
Enumerator |
---|
Success |
Successfully connected to the Engine.
|
Error |
Error, See the reason structure for detail error.
|
Connect to engine.
Connect to a non graphical engine connects to a already running non graphics engine. If no non graphics engine found it starts a new instance of engine and connect to that engine Connect to a graphical engine connects to a already running Graphical engine. If no graphical engine found it does not start any engine. Multiple application connecting to a engine may cause the engine to behave unexpectedly and should be avoided. Disconnect the engine as soon as the publishing is done so that no other application can connecting to a same engine.
- Parameters
-
[in] | engine | Desired engine to connect. Only one connection is possible at a time. So, to connect another engine, user need to disconnect already connected engine. |
[in] | seedFile | Seedfile path. To use already opened DGN file, pass blank string. If the file path is not valid, it will not load the seed file. |
[in] | connectGraphicalEngine | true to connect UI engine, false to connect Non-ui engine in background |
- Returns
- status of the connection Connection may fail due to various reason. Main reason could be uninitialized engine. In that case, user have to wait for the engine to load all its module. If failed to connect on first attempt, try to connect after couple of minute.
- See also
- ConnectionStatus
static void DeleteManagerObj |
( |
| ) |
|
|
static |
Delete connection manager object.
Disconnect the engine If connected to non graphical engine, it will stop the engine, however, it does not stop any Graphical engine.
- Parameters
-
[in] | engine | Desired engine to disconnect. |
- Returns
- status of the operation, 0 for Success. -1 for Error.
Discover available engines in the machine.
On subsequent call, it will not renew the engine list.
- Returns
- count of available engines
Get display name of the engine.
Full name of the product i.e. 'MicroStation V8i (SELECTseries 3)'
- Parameters
-
[out] | displayName | DisplayName of the engine |
Get display version of the engine.
i.e. 08.11.09.260
- Parameters
-
[out] | displayVersion | DisplayVersion of the engine |
IModelEngine* GetEngine |
( |
int |
index | ) |
|
Get IModelEngine object pointer at the index.
- Parameters
-
[in] | index | Engine at index place will be retrieved |
- Returns
- IModelEngineP. If not found any engine at index, return NULL
static ConnectionManager* GetManagerObj |
( |
| ) |
|
|
static |
Get name of the engine.
A short name of the product i.e. 'MicroStation'
- Parameters
-
[out] | name | Name of the engine |
Get full path of the engine.
- Parameters
-
[out] | programFullPath | ProgramPath along with the exe path of the engine |
Get folder path of the engine.
- Parameters
-
[out] | programPath | Program folder path of the engine |
Get version of the engine.
Similer to Display Version in the form of 081109260
- Parameters
-
[out] | version | Version of the engine |
Get workspace path of the engine.
- Parameters
-
[out] | workspacePath | WorkspacePath of the engine |
Load user app in the engine.
- Parameters
-
[in] | appPath | User application path including the dll name. The path of App should be inside the Engine's installed folder. Suppose the Engine is installed at "c:\\Program Files (x86)\\Bentley 08.11.09.260\\MicroStation\\", then the App path should be "c:\\Program Files (x86)\\Bentley 08.11.09.260\\MicroStation\\mdlapps\\userApp.dll", where "userApp.dll" is the app that user want to load using LoadApp method. If the user App path is outside the engine's install path then Engine might fail to load the App. |
- Returns
- status of the operation, SUCCESS ( 0 ) or ERROR ( -1 ) if app path is not found
StatusInt Bentley::IPC::SendImodelMessage |
( |
WStringR |
messageString | ) |
|
Send message to IModel host application.
- Parameters
-
[in] | messageString | Message. Max 256 char long |
- Returns
- status of the operation. Error if Server is not found. To start server user need to call ConnectionManager::Connect method from 3rd party application.
Set message callback.
- Parameters
-
[in] | callback | callback method |
- Returns
- status of the operation, SUCCESS ( 0 ) or ERROR ( -1 ).
Start user Key-in.
- Parameters
-
- Returns
- status of the operation, SUCCESS ( 0 ) or ERROR ( -1 ).. If the KeyinString is blank then it return ERROR Please use the following snippet to call the user Key-ins
int count = cm->DiscoverEngines ();
if ( 0 == count )
return;
engine->
LoadApp ( L
"c:\\Program Files (x86)\\Bentley 08.11.09.260\\MicroStation\\mdlapps\\userApp.dll",);
engine->StartApp ( L"ReadImodel" );