While within my MVBA class ILocateCommandEvents pressing the Reset button brings up a Pop Up window instead of running the sub Private Sub ILocateCommandEvents_LocateReset().
what is the solution?
Happy New year
Patrick
Patrick: While within my MVBA class ILocateCommandEvents pressing the Reset button brings up a Pop Up window
What Pop Up window?
Regards, Jon Summers LA Solutions
This one Jon
Patrick Wheatley: While within my MVBA class ILocateCommandEvents pressing the Reset button brings up a Pop Up window instead of running the sub Private Sub ILocateCommandEvents_LocateReset().
Patrick,
The LocateReset event is not what some people think; it is not triggered by a user pressing the Reset button. Below is a quote from the uStn VBA Help File: MicroStation does not call the LocateReset event handler when the user presses reset to reject the currently highlighted element. MicroStation only calls LocateReset when there is no element to reject. At that point, there is no standard behavior so MicroStation calls the LocateReset event handler.
You want to use the IPrimitiveCommandEvents objects to do what you are trying to do. From the VBA help: The event-handling methods of the IPrimitiveCommandEvents interface are Keyin, DataPoint, Reset, Cleanup, Dynamics and Start. This should get you headed in the right direction.
Gerald
what does this mean calls LocateReset when there is no element to reject ?
I've tried DataPointing on nothing to get a reset with out luck. Any suggestions?
What I find puzzling is that I was able to call LocateReset with a Reset in V8 2004 with no problems.
I've decided to go down the IPrimitiveCommandEvents as suggested by DeanLyon which works better as I do not have to accept the elements.
thanks for your help
I didn't ask what the desired work flow would be for what you want to accomplish. Indeed, some times the IPrimitiveCommandEvents interface will prove to match the desired workflow better. To use this interface for Locating elements in a user friendly manner generally requires more code, but it can provide the flexibility desired.
ILocateCommandEvents_LocateReset can be tricky. My previous comment certainly wasn't clear. You certainly can trigger the LocateReset Event with a user Reset. However, this event is only triggered in specific circumstances. Particularly if no candidate element can be located at the current location and the class is NOT waiting for an Accept/Reject from the user. One thing that can confuse the issue is if AccuSnap is enabled. If "Identify Elements Automatically" is enabled and something is hilighted, then the ILocateCommandEvents_LocateReset won't get called because it is looking for an Accept/Reject.
Rather difficult to explain. Constructing a class and testing the options is usually the easiest way to grasp what is really happening.
G
hmm...
There I go jumping immediately to the more complicated potential issue... Patrick, could you take a look at: Workspace->Preferences->Input What does it show for the following options?: Reset Pop-up Menu (If set to Click, could cause what you are seeing) Hold Delay (If set to very short time, could cause what you are seeing)
Click on Workspace -> Preferences
Click on Input
Set Reset Pop-up Menu to "Press and Hold"