public void Switchlevel(DatumExtentType dantumtype, List <Level> levels) { if (levels.Count != 0) { foreach (Level i in levels) { var start = i.GetDatumExtentTypeInView(DatumEnds.End0, doc.ActiveView); var end = i.GetDatumExtentTypeInView(DatumEnds.End1, doc.ActiveView); if (dantumtype == DatumExtentType.Model) { if (start == DatumExtentType.Model) { continue; } else if (start == DatumExtentType.ViewSpecific) { i.SetDatumExtentType(DatumEnds.End0, doc.ActiveView, DatumExtentType.Model); } if (end == DatumExtentType.Model) { continue; } else if (end == DatumExtentType.ViewSpecific) { i.SetDatumExtentType(DatumEnds.End1, doc.ActiveView, DatumExtentType.Model); } } if (dantumtype == DatumExtentType.ViewSpecific) { if (start == DatumExtentType.Model) { i.SetDatumExtentType(DatumEnds.End0, doc.ActiveView, DatumExtentType.ViewSpecific); } else if (start == DatumExtentType.ViewSpecific) { continue; } if (end == DatumExtentType.Model) { i.SetDatumExtentType(DatumEnds.End1, doc.ActiveView, DatumExtentType.ViewSpecific); } else if (end == DatumExtentType.ViewSpecific) { continue; } } } } }
private static void SwitchDatumExtentType(View view, IEnumerable <Grid> grids, DatumExtentType datumExtentType) { foreach (var grid in grids) { grid.SetDatumExtentType(DatumEnds.End0, view, datumExtentType); grid.SetDatumExtentType(DatumEnds.End1, view, datumExtentType); } }