event when user interactively places a reference or raster?

Hi,

I am triggering a reference/raster attachment via the CadInputQueue.SendCommand() method, e.g.:

m_ustnApp.CadInputQueue.SendCommand("raster attach interactive \"+filePath+"\"");

m_ustnApp.CadInputQueue.SendCommand("rf=\"+filePath+"\",,,,");

What I'm looking for is an event notification that the user has INTERACTIVELY placed the reference/raster, or cancelled the operation, but I can't seem to find any such thing. If I use the IAttachmentEvents or IRasterEvents handlers, they notify me when a file is attached or loaded, but not when it is *placed* or cancelled.

I have also tried looking for an event that is triggered when the active command changes (e.g. I could watch for "Attach Raster" changing to something else and check for the existence of a new attached raster file) but I can't find anything like that either.

Can anyone offer any advice? Thanks.

Parents
  • Hi,

    peeveen said:
    If I use the IAttachmentEvents or IRasterEvents handlers, they notify me when a file is attached or loaded, but not when it is *placed* or cancelled.

    It's necessary to distinguish between events processed by MicroStation and what happens "inside a function", because it is not usually known to MicroStation. I guess MicroStation knows when "attach reference" tool is started (because the command is processed by InputQueue and MicroStation state machine) and when it's placed (because a design file is modified and a new element is added), but MicroStation probably does not know details how the reference is placed, because it's an internal workflow of the tool itself. But it's just my guess and should be tested using a proper code.

    peeveen said:
    Can anyone offer any advice?

    You did not write what MicroStation do you use (I recommend to read and follow MicroStation Programming Forum best practices), but in general managed code is not the right tool to monitor MicroStation events. If you need tightly integrate with MicroStation and to monitor internal events, you have to use MDL C API.

    In my opinon you should start with mdlSystem_setFunction and mdlInput_setFunction, because they allow to monitor wide variety of system events and MicroStation input queue. After you will be able to check a content of input queue and related system events when Attach Reference and Attach Raster tools are used, it should become clearer what types of information are accessible.

    With regards,

      Jan

Reply
  • Hi,

    peeveen said:
    If I use the IAttachmentEvents or IRasterEvents handlers, they notify me when a file is attached or loaded, but not when it is *placed* or cancelled.

    It's necessary to distinguish between events processed by MicroStation and what happens "inside a function", because it is not usually known to MicroStation. I guess MicroStation knows when "attach reference" tool is started (because the command is processed by InputQueue and MicroStation state machine) and when it's placed (because a design file is modified and a new element is added), but MicroStation probably does not know details how the reference is placed, because it's an internal workflow of the tool itself. But it's just my guess and should be tested using a proper code.

    peeveen said:
    Can anyone offer any advice?

    You did not write what MicroStation do you use (I recommend to read and follow MicroStation Programming Forum best practices), but in general managed code is not the right tool to monitor MicroStation events. If you need tightly integrate with MicroStation and to monitor internal events, you have to use MDL C API.

    In my opinon you should start with mdlSystem_setFunction and mdlInput_setFunction, because they allow to monitor wide variety of system events and MicroStation input queue. After you will be able to check a content of input queue and related system events when Attach Reference and Attach Raster tools are used, it should become clearer what types of information are accessible.

    With regards,

      Jan

Children
No Data