I have created a plugin written in C# that runs in Autocad. The plugin opens a window and allows the user to select several options to restore default settings for the sheet. When I run a command that requires additional user input beyond the button on the window, a blank white box pops up called "Hidden Window" and disappears after the command runs. How do I stop this from happening. Any help would be greatly appreciated.
This is the initialization command for the window.
public class Initialize
{
[CommandMethod("Defaults")]
public static void window()
{
GUI window
= new GUI
(); //initializes window window.ShowDialog();
}
}
This is the command for the additional user input.
public static void UpdateLayer()
{
Document acDoc = Application.DocumentManager.MdiActiveDocument; //AutoCAD document name in program space
Database acCurDb = acDoc.Database; //AutoCAD database name in program space
Editor ed = acDoc.Editor; //AutoCAD document editor
PromptDistanceOptions prompt
= new PromptDistanceOptions
(""); prompt.Message = "\nWould you like to add missing layers?";
prompt.Keywords.Add("Yes");
prompt.Keywords.Add("No");
PromptDoubleResult result = acDoc.Editor.GetDistance(prompt);
//Updates the missing engineering layers in the autocad drawing
if (result.StringResult == "Yes")
{
Globals.NoCreate(1);
}
//runs the first command so the description can correctly update
else if (result.StringResult == "No")
{
Globals.NoCreate(0);
}
EngineeringLayersDatabase.UpdateLayer();
}
edit kdub: added code=csharp