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();
}