PDA

View Full Version : ^C^C and pick point question



Coolmo
2005-01-28, 04:18 PM
Is there an equivalent to ^C^C (cancel current command) in VBA? I need to make sure nothing else is running before the private sub starts doing it's thing. Since I have my program in a modeless form, it is always up on screen so the user can be in the middle of a command and still click one of my buttons. AutoCAD locks up because it's still in the original command and nothing recovers it (to my knowledge) other than shutting down with task manager.

Also, I have a program (userform) that stays on the screen modeless until the user clicks a commandbutton to activate the getpoint method. The problem I'm having is that the user can type either 'PAN or '_PAN on the command to transparent pan before picking his/her point without a problem but as soon as they try to access transparent pan through the toolbar it comes back with an error. What causes this? The code in the toolbar is simply '_PAN. What's the difference and how can I fix this?

Ed Jobe
2005-01-28, 04:36 PM
I'm heading out of the office now, I don't have time to get into the second question other than it is a limitation of the vba api. As for the first, check out the SendKeys function.

Coolmo
2005-02-02, 02:57 PM
Just wanted to update everyone on the ^c^c question. My main goal was to exit out of any command that was running before my VBA sub ran (form was up modeless, which allowed the user to click a button while in a command). Instead of ^c^c to get out of the command I used:

If ThisDrawing.Application.GetAcadState.IsQuiescent = True Then......

to see if AutoCAD was busy before the command ran. It worked great so I thought I'd share this with those out there who didn't know you could do that. Thanks.