SendStringToExecute

SendStringToExecute

Anonymous
Not applicable
703 Views
3 Replies
Message 1 of 4

SendStringToExecute

Anonymous
Not applicable
I have an autocad palette with a button on it. The following code is under the click event for the button
{code}
AcApp.DocumentManager.MdiActiveDocument.SendStringToExecute(String.Format("NameOfCommand{0}", vbLf), False, False, False)
{code}
My problem is that this line is not run until the mouse is moved in the drawing space. I want the command to run as soon as the button is clicked.
0 Likes
704 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Hi,

have you tried adding "\n" at the end of the command ?

SendStringToExecute(String.Format("NameOfCommand{0}", vbLf) + "\n",....)
0 Likes
Message 3 of 4

Anonymous
Not applicable
That's what the vbLF is for. The second parameter is called activate and I had it set to false like this:
SendStringToExecute(String.Format("NameOfCommand{0}", vbLf), False, False, False)

If you set it to True, like below, the command is run in autocad as soon as the button is clicked
SendStringToExecute(String.Format("NameOfCommand{0}", vbLf), True, False, False) Edited by: tcampbell5 on Jul 9, 2009 1:33 PM
0 Likes
Message 4 of 4

Anonymous
Not applicable
Autodesk.AutoCAD.Internal.Utils.SetFocusToDwgView()

Not sure what release the above was added.

To use it in AutoCAD 2009 you need to add a reference to acmdginternal.dll.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");


wrote in message news:[email protected]...
I have an autocad palette with a button on it. The following code is under
the click event for the button
{code}
AcApp.DocumentManager.MdiActiveDocument.SendStringToExecute(String.Format("NameOfCommand{0}",
vbLf), False, False, False)
{code}
My problem is that this line is not run until the mouse is moved in the
drawing space. I want the command to run as soon as the button is clicked.
0 Likes