/// <summary> /// Returns an enumerable collection of drawing objects of the specified type in the specified section. /// </summary> /// <param name="document"></param> /// <param name="sectionType"></param> /// <returns></returns> public static IEnumerable <object> EnumerateDrawingObjects <T>(this SolidEdgeDraft.DraftDocument document, SolidEdgeDraft.SheetSectionTypeConstants sectionType) where T : class { foreach (SolidEdgeDraft.Section section in document.Sections) { if (section.Type == sectionType) { foreach (var drawingObject in section.EnumerateDrawingObjects <T>()) { yield return(drawingObject); } } } }
/// <summary> /// Returns an enumerable collection of drawing views in the specified section. /// </summary> /// <param name="document"></param> /// <param name="sectionType"></param> /// <returns></returns> public static IEnumerable <SolidEdgeDraft.DrawingView> EnumerateDrawingViews(this SolidEdgeDraft.DraftDocument document, SolidEdgeDraft.SheetSectionTypeConstants sectionType) { foreach (SolidEdgeDraft.Section section in document.Sections) { if (section.Type == sectionType) { foreach (SolidEdgeDraft.DrawingView drawingView in section.EnumerateDrawingViews()) { yield return(drawingView); } } } }