Code: Select all
cadImage = CADImport.CADImage.CreateImageByExtension(fileName);
if (cadImage != null)
{
cadImage.LoadFromFile(fileName);
for (int index = 0; index < cadImage.Layouts.Count; index++)
{
CADImport.CADLayout layout = cadImage.Layouts[index];
if (cadImage.Layouts[index].Name.Equals("Model", StringComparison.InvariantCultureIgnoreCase))
{
foreach (CADImport.CADEntity ent in layout.Entities)
{
ProcessDWGEntity(cadImage, ent);
}
}
}
}
Code: Select all
CADImport.CADInsert ins = ent as CADImport.CADInsert;
if(ent is CADImport.CADLeader)
ins = (ent as CADImport.CADLeader).Insert;
Color entColor = CADImport.CADConst.EntColor(ent, ins);
if (entColor.ToArgb() == 0)
entColor = cadImage.DefaultColor;
Should I be using Iterate instead of how I'm doing it?