PDA

View Full Version : PromptPointOptions Question



Coolmo
2009-09-16, 12:56 PM
Everything works great as far as prompting the user and getting the point but how do you get the command line to clear after the user picks a point or does what you're asking them to do? If you run the same command without clearing the command line, the same prompt shows up after the first prompt, and so on, and so on. See below...

Pick point on screen:Pick point on screen:Pick point on screen:

How do Io clear this and go to a fresh command line "Command:"?

RobertB
2009-09-16, 02:33 PM
What does your prompt string look like? In the code.

sinc
2009-09-16, 03:56 PM
It won't go to the Command prompt until the current command is done executing, i.e. when your routine exits.

If you don't want consecutive prompts to be on the same line, include a newline in the prompt. I usually like to put it on the leading edge of strings. For example, change the prompt string to "\nPick point on screen:" instead of "Pick point on screen:"

Coolmo
2009-09-17, 01:37 PM
I didn't know that the new line character could be used in VB.net. I always used it in Lisp and thought it was specific to that. If that works it'll take care of the multiple prompts in the program but I still need to resolve the issue of going back to the command line "Command:" after the program is done.

The program is simple. It basically prompts the user for an insertion point for a new piece of Mtext and then if the promptpoint.status is OK it then inserts the new Mtext into the drawing. After that it just sits and looks at me with the "Pick Insertion Point..." prompt still at the command line and no "Command:" ready for the next one. You can however type a new command after all of this and it still works. This is what the command line looks like when you type LINE after my mtext program inserts the mtext:

Command: Pick Insertion Point For New Mtext: LINE

After hitting enter to run the LINE command, all is well.

Ideas?

Coolmo
2009-09-18, 12:40 PM
A registered command method defeats the purpose of my program(s) because they all rely on selecting things from a modeless dialog. I have tried and noticed that when you run the code inside a command method, it automatically returns back to the command line.

I found a way around all of this though. After my program stops prompting the user and does all of its "stuff" on screen, I simply use a SendStringToExecute() to send the command "REDRAW" to the command line which Redraws the screen (basically does nothing except wipe out the old-school "blips") and then returns back to the AutoCAD Command: line. I specifically did not use REGEN just in case there was a giant file loaded or something else to bog it down. I put this into my program last night and it works great.