sendStringToExecute Problem

sendStringToExecute Problem

Anonymous
Not applicable
927 Views
8 Replies
Message 1 of 9

sendStringToExecute Problem

Anonymous
Not applicable
I'm using acDocManager->sendStringToExecute(curDoc(), "ddedit "); to send the ddedit command when a dimension is double clicked.
This works fine until the ddedit dialog box is closed.
When the box is closed the ddedit command is still active with:
"Select an annotation object or [Undo]:"
How can I end the command after the dialog is closed without having to do this manually?
FYI...I'm just beginning with .arx.
0 Likes
928 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
> How can I end the command after the dialog is closed without
> having to do this manually?

Try removing the trailing space from the string you send via
sendStringToExecute(). 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes
Message 3 of 9

Anonymous
Not applicable
Owen,
Thanks for your reply!
I took out the trailing space and the command is not activated.
Any other ideas?

Thanks
0 Likes
Message 4 of 9

Anonymous
Not applicable
> I took out the trailing space and the command is not activated.

What happens if you send nothing? Does the ddedit command start then? If
not, then it would seem that something is repeating the command. You could
change double click editing settings in AutoCAD to see if that makes any
difference. 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes
Message 5 of 9

Anonymous
Not applicable
I sent nothing and ddedit was not activated.
I called ddedit and before "Select an annotation object or [Undo]:" displayed on the command line the edit text dialog popped up. After that was closed, then the "Select an annotation object or [Undo]:" was displayed.

What I want it to do is if a dimension is double clicked activate ddedit, use item that was double clicked as the object to select, then when the dialog is closed I want to exit the command.

Fyi... I started out with the ObjectARX DblClk example.
0 Likes
Message 6 of 9

Anonymous
Not applicable
> I called ddedit and before "Select an annotation object or [Undo]:"
> displayed on the command line the edit text dialog popped up. After
> that was closed, then the "Select an annotation object or [Undo]:"
> was displayed.

I just did a quick test in AutoCAD 2006, and it looks like DDEDIT
continues to ask for entities until you tell it you're finished. I'm not
sure if you can prevent it from doing that, but you could just send an
additional "\n" character in your sendStringToExecute() call to exit the
command. 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes
Message 7 of 9

Anonymous
Not applicable
I'm running 2006 also.

I added the \n and that makes the command exit without showing the dialog box.
I tried using the \n in various locations but no luck.

I'm not sure if I'm approaching the double click dimension solution in the correct way. A little frustrated at this point though.

Thank you very much for your help!
0 Likes
Message 8 of 9

Anonymous
Not applicable
> I added the \n and that makes the command exit without
> showing the dialog box.

It probably shows it, but the carriage return dismisses it immediately.
In that case, you need to revert to plan B. Define your own command, say
MYDDEDIT, with the ACRX_CMD_USEPICKSET and ACRX_CMD_NO_UNDO_MARKER command
flags, then call MYDDEDIT via sendStringToExecute. MYDDEDIT can use
acedCommand() to call the DDEDIT command synchronously and exit the 'Select
object' prompt after the dialog is closed:
acedCommand( RTSTR, "_DDEDIT", RTSTR, "\n", 0 );
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes
Message 9 of 9

Anonymous
Not applicable
Thanks for the suggestion!
I've never created my own command but I'll look into that.
0 Likes