Skip to content

Commit

Permalink
Add support to area scheme schedule names
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyNefyodov committed Apr 26, 2024
1 parent 44ae574 commit 20f3131
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,20 @@ ResolveSet ResolveDefaultNameForMaterialTakeoff()
ResolveSet ResolveDefaultNameForSchedule()
{
var categories = ViewSchedule.GetValidCategoriesForSchedule();
var resolveSummary = new ResolveSet(categories.Count);
var areas = context.EnumerateInstances<AreaScheme>().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;
Expand Down Expand Up @@ -174,7 +183,7 @@ ResolveSet ResolveScheduleInstances()
var count = viewSchedule.GetSegmentCount();
var resolveSummary = new ResolveSet(count);

for (var i = 0; i<count; i++)
for (var i = 0; i < count; i++)
{
resolveSummary.AppendVariant(viewSchedule.GetScheduleInstances(i));
}
Expand All @@ -187,13 +196,13 @@ ResolveSet ResolveSegmentHeight()
var count = viewSchedule.GetSegmentCount();
var resolveSummary = new ResolveSet(count);

for (var i = 0; i<count; i++)
for (var i = 0; i < count; i++)
{
resolveSummary.AppendVariant(viewSchedule.GetSegmentHeight(i));
}

return resolveSummary;
}
#endif
#endif
}
}

0 comments on commit 20f3131

Please sign in to comment.