From 20f31316eff0ec5cc783e58627723036ae0886ec Mon Sep 17 00:00:00 2001 From: SergeyNefyodov Date: Fri, 26 Apr 2024 16:53:09 +0200 Subject: [PATCH] Add support to area scheme schedule names --- .../Descriptors/ViewScheduleDescriptor.cs | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/ViewScheduleDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/ViewScheduleDescriptor.cs index 861e9b97..927fa92f 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/ViewScheduleDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/ViewScheduleDescriptor.cs @@ -106,11 +106,20 @@ ResolveSet ResolveDefaultNameForMaterialTakeoff() ResolveSet ResolveDefaultNameForSchedule() { var categories = ViewSchedule.GetValidCategoriesForSchedule(); - var resolveSummary = new ResolveSet(categories.Count); + var areas = context.EnumerateInstances().ToArray(); + var resolveSummary = new ResolveSet(categories.Count + areas.Length - 1); + var areaId = new ElementId(BuiltInCategory.OST_Areas); foreach (var id in categories) { - if (id == new ElementId(BuiltInCategory.OST_Areas)) continue; - resolveSummary.AppendVariant(ViewSchedule.GetDefaultNameForSchedule(context, id)); + if (id == areaId) + { + foreach (var area in areas) + { + resolveSummary.AppendVariant(ViewSchedule.GetDefaultNameForSchedule(context, id, area.Id)); + } + } + else + resolveSummary.AppendVariant(ViewSchedule.GetDefaultNameForSchedule(context, id)); } return resolveSummary; @@ -174,7 +183,7 @@ ResolveSet ResolveScheduleInstances() var count = viewSchedule.GetSegmentCount(); var resolveSummary = new ResolveSet(count); - for (var i = 0; i