Event for export & Import of stp and igs file types

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

  • 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'?

    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...

    /*----------------------------------------------------------------------+
     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,

    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?

    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.

    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).

    • MicroStation event is API concept, allowing to register to listen, when something happens. Your code is called when particular event is triggered (e.g. when Save as is used or something is written to a model).
    • Command ID (in CE we should probably talk about XCommand) is unique identification of operation in MicroStation input queue, so it's more "implementation concept", how MicroStation works internally.

    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.

    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