Hi.
I add a form to my app to allow user to input some data, and then I want to clicking a button to run a command. This is want I do.
(1) add a from to my project,I call it "UserInput", and put some controls on it. A button is on the form to fire a command.
(2) double click the button, and add the following codes.
private void btnDoor_Click(object sender, EventArgs e)
{
Autodesk.AutoCAD.ApplicationServices.Document doc =
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
//Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
doc.SendStringToExecute("Door",true,true,true);
}
(3) to show the form, define a command
[CommandMethod("UserInput")]
public void ShowInput()
{
UserInput frmUser = new UserInput(); //UserInput is the form class I added.
Application.ShowModalDialog(frmUser);
}
Now, I run the "UserInput" command, the form showed successfully, but when I click the button, I get a "Error" showing "InValidInput". What's this. Where is the problem? Did I pass the wrong arguments to the SendStringToExecute()? How to fix it?