.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get the data from a routine which is registered to AutoCAD Command

2 REPLIES 2
Reply
Message 1 of 3
springgump
113 Views, 2 Replies

How to get the data from a routine which is registered to AutoCAD Command

There are three controls on a docking pallette, one "Textbox" and tow "Button". Button2 change the TextBox's text directly, it works, Button1 do it by executing a AutoCAD command, it doesn't works. Why?
As if the rountine register to AutoCAD Command is annother thread...Is there a way to get data form routine which is registered to AutoCAD Command? I need it to interact with the dockingpallette.

Below is the code and the source file is in the attachment.:

//Button1 can not change the Textbox, but Button2 do, why? Please help.

private void button1_Click(object sender, EventArgs e)
{
AcadApp.DocumentManager.MdiActiveDocument.SendStringToExecute("CommandName\n", true, false, false);
}
[Autodesk.AutoCAD.Runtime.CommandMethod("CommandName")]
public void aRountine()
{
// Notice, it can not change the TextBox1
this.textBox1.Text = "abc";
MessageBox.Show("this.textBox1.Text is: " + this.textBox1.Text,"Click form Button1");
}

private void button2_Click(object sender, EventArgs e)
{
this.textBox1.Text = "abc";
MessageBox.Show("this.textBox1.Text is: " + this.textBox1.Text, "Click form Button2");
}

}

Thanks for any help.
2 REPLIES 2
Message 2 of 3
springgump
in reply to: springgump

PS: Using AutoCAD2007 and Visual Studio2005
Message 3 of 3
springgump
in reply to: springgump

how can i delete this topic? the attachment is here

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost