Looking for a piece of VBA code to move the mouse cursor to xy drawing coordinate (say 100,100) within Micro station.
Microstation version: Power inroads V8i SS4
many thanks,
Vinoth Joseph
Unknown said:Error P0 not defined
P0 is your variable.
P0
Regards, Jon Summers LA Solutions
my apologize. got corrected.
ATKINS
Bangalore, India
Unknown said:CadInputQueue.SendKeyin p0
Try this statement. The final True places a Ctrl key in MicroStation's input queue...
True
CadInputQueue.SendKeyin p0, True
Error P0 not defined. what will be P0 variable and its value ?
Unknown said:"^" push the ctrl key. which is required to enable multi point option
Try using this statement to send the Ctrl key to MicroStation...
Const ControlKey As Boolean = True CadInputQueue.SendKeyin p0, ControlKey
See this post for an explanation.
You could use the following method http://imgur.com/a/ry0A9 Ex: ActiveDesignFile.Views(1).GetPixelPosition(p, False)
Then you can use SetCursorPos http://pinvoke.net/default.aspx/user32.SetCursorPosYou may run into some issues with multiple monitors, but that may be the best you can do.
Unknown said:sleep 1 - will pause the command action for 1 ms
I'm not asking you to explain VBA. I'm asking why that statement is there and what is its purpose.
Unknown said:"^" push the ctrl key
That probably doesn't do what you want. It's sending the caret symbol to a Windows input queue, not to MicroStation's input queue, which is where you want it to go.
CadInputQueue.SendKeyin has an optional parameter Qualifier. It's unodocumented, and there's no example of its use. Perhaps that is what you need?
CadInputQueue.SendKeyin
Qualifier
sleep 1 - will pause the command action for 1 ms.
"^" push the ctrl key. which is required to enable multi point option while placing conduit.
Unknown said:Sleep 1 'working fine
What is the intention of Sleep 1?
Sleep 1
What is the purpose of VBA.SendKeys "^", True?
VBA.SendKeys "^", True