Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: [V8i] [C# .NET] Using Undo function in IPrimitive Event

$
0
0

Hi,

[quote user="clever_anthony"]I would like to write a tool which is similar to place smart line[/quote]

COM API used in V8i for managed code has plenty of limitations, not only the discussed one. Some features used by MicroStation tools require native C/C++ code.

[quote user="clever_anthony"]However, when you are in IPrimitive Event, using Ctrl + Z will directly interrupt it and the IPrimitive Event will no longer workable.[/quote]

What you can try is to register key event handler using  Bentley.Interop.MicroStationDGN.Application.AddWindowsKeyMessageEventsHandler method and to try to handle (block) the key event (Ctrl+Z), so it will be consumed by your addin and not by MicroStation. I am not sure if it will work, maybe MicroStation handles the key before it's passed to addin, but it's the simplest way I know how to consume key events in IPrimitiveCommandEvent code.

[quote user="clever_anthony"] Moreover, in CONNECT Edition, I see this problem is still existing. [/quote]

I guess it's more VBA API feature than the bug, because it's how VBA API was designed. In addition to that, in COM API is not treated anymore as the primary managed API and is replaced by DgnPlatformNet. Using this new API, you can implement DgnPrimitiveTool that offers OnUndoPreviousStep, which I guess is the way how to handle undo steps inside own tool. You can see e.g. ManagedToolsExample delivered with MicroStation SDK CONNECT Edition.

With regards,

  Jan


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>