The code below populates a ComboBox control with drawing template (dwt) files. When I debug this code, the line: AcadApplication acadApp = new AcadApplication(); can take up to 15 seconds before moving onto the next statement. Does anyone have any ideas why I am encountering such a delay?
private void DetailSheetForm_Load(object sender, EventArgs e)
{
AcadApplication acadApp = new AcadApplication();
string templatePath = acadApp.Preferences.Files.TemplateDwgPath;
DirectoryInfo di = new DirectoryInfo(templatePath);
FileInfo[] templateFiles = di.GetFiles("*.dwt");
// Populate the Template ComboBox.
foreach (FileInfo item in templateFiles)
{
if (!cboTemplate.Items.Contains(item))
cboTemplate.Items.Add(item);
}
}
p.s. My operating environment is: Vista Pro, Visual Studio 2008 Pro, and AutoCAD 2009.