We have developed a Native C++ application for MicroStation Connect Edition 10.15.02.11
Since we encrypt the exported files with .igs and .stp formats. While exporting a dgn to .igs or .stp file type, can we get any event to identify the process ? Similarly for import also we need an event. For eg. a unique command ID while doing export and import.
Regards
Rama. Shrinivasan
Rama Shrinivasan said:While exporting a dgn to .igs or .stp file type, can we get any event to identify the process ?
If you have written the exporter, what event do you expect to see from MicroStation?
What do you mean by 'identify the process'?
Rama Shrinivasan said: a unique command ID while doing export and import
Your application can have its own set of commands. You must write a command table. For example, key-in command
RAMA EXPORT IGS
would have a numeric equivalent generated by the SDK resource compiler. See any of the C++ SDK examples (\SDK\examples\Elements\ElementsExample) for more info...
\SDK\examples\Elements\ElementsExample
/*----------------------------------------------------------------------+ Main command table +----------------------------------------------------------------------*/ CommandTable CT_MAIN = { { 1, CT_ELEMENTS, MANIPULATION, REQ, "ELEMENTSEXAMPLE" }, }; CommandTable CT_ELEMENTS = { { 1, CT_CREATE, INHERIT, REQ, "SHAPE", }, { 2, CT_CREATE, INHERIT, REQ, "MULTILINE", }, { 3, CT_OPERATIONS, INHERIT, REQ, "ELEMENT", }, };
Or do you mean somethign else by 'unique command ID'?
Regards, Jon Summers LA Solutions
Hi Rama,
Rama Shrinivasan said:While exporting a dgn to .igs or .stp file type
How do you interact with the mentioned tools? Your application sends key-ins? Or it's controlled by a user?
Rama Shrinivasan said:can we get any event to identify the process ?
In general: not. Export tools are the same applications like your code, not part of MicroStation core (DWG support is I guess the only exception), so they can be treated as black boxes.
Rama Shrinivasan said:Similarly for import also we need an event. For eg. a unique command ID
You are mixing two different topics (pines and apples): event and command ID (in input queue).
You can listen (monitor) input queue and to be informed about different events, representing different phases of processing inputs from different sources. In this case, Command ID is part of received data.
Rama Shrinivasan said:For eg. a unique command ID while doing export and import.
To monitor input queue is I guess the only thing you can try. But, I assume it's not straightforward, because to start export or import tool does not mean that the process itself is started, but that the tool is started.
It's up to you to analyze complete input queue to understand how the tool interact internally with MicroStation. What input queue elements should be filtered depends also on how you start the export itself.
I can imagine (but it requires detail analysis) something like "the tool is started" can be used to identify when process (possibly) begins, whereas something like "start default command" or "MicroStation is idle" can represent "the export is finished".
Alternatively, and personally I would prefer this way, is to ignore MicroStation API and to use Windows file system monitoring API to check, when the exported file is closed, so it can be processed further by your application.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point