Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Nice3point committed May 7, 2024
1 parent 6540e24 commit 415ec31
Showing 1 changed file with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public sealed class IndependentTagDescriptor(IndependentTag tag) : ElementDescri
return target switch
{
#if REVIT2025_OR_GREATER
nameof(IndependentTag.TagText) when RebarBendingDetail.IsBendingDetail(tag) => ResolveSet.Append(new NotSupportedException("RebarBendingDetail not supported. Revit API critical Exception")),
nameof(IndependentTag.TagText) when RebarBendingDetail.IsBendingDetail(tag) =>
ResolveSet.Append(new NotSupportedException("RebarBendingDetail not supported. Revit API critical Exception")),
#endif
nameof(IndependentTag.CanLeaderEndConditionBeAssigned) => ResolveLeaderEndCondition(),
#if REVIT2022_OR_GREATER
Expand All @@ -53,7 +54,8 @@ ResolveSet ResolveLeaderEndCondition()

foreach (LeaderEndCondition condition in conditions)
{
resolveSummary.AppendVariant(tag.CanLeaderEndConditionBeAssigned(condition), condition.ToString());
var result = tag.CanLeaderEndConditionBeAssigned(condition);
resolveSummary.AppendVariant(result, $"{condition}: {result}");
}

return resolveSummary;
Expand All @@ -66,8 +68,10 @@ ResolveSet ResolveLeaderElbow()

foreach (var reference in references)
{
if (tag.IsLeaderVisible(reference) && tag.HasLeaderElbow(reference))
resolveSummary.AppendVariant(tag.GetLeaderElbow(reference));
if (!tag.IsLeaderVisible(reference)) continue;
if (!tag.HasLeaderElbow(reference)) continue;

resolveSummary.AppendVariant(tag.GetLeaderElbow(reference));
}

return resolveSummary;
Expand All @@ -76,14 +80,18 @@ ResolveSet ResolveLeaderElbow()
ResolveSet ResolveLeaderEnd()
{
if (tag.LeaderEndCondition == LeaderEndCondition.Attached)
return ResolveSet.Append("The tag has attached leader end condition, it has no LeaderEnd");
{
return new ResolveSet();
}

var references = tag.GetTaggedReferences();
var resolveSummary = new ResolveSet(references.Count);

foreach (var reference in references)
{
if (tag.IsLeaderVisible(reference))
resolveSummary.AppendVariant(tag.GetLeaderEnd(reference));
if (!tag.IsLeaderVisible(reference)) continue;

resolveSummary.AppendVariant(tag.GetLeaderEnd(reference));
}

return resolveSummary;
Expand All @@ -95,8 +103,9 @@ ResolveSet ResolveHasLeaderElbow()
var resolveSummary = new ResolveSet(references.Count);
foreach (var reference in references)
{
if (tag.IsLeaderVisible(reference))
resolveSummary.AppendVariant(tag.HasLeaderElbow(reference));
if (!tag.IsLeaderVisible(reference)) continue;

resolveSummary.AppendVariant(tag.HasLeaderElbow(reference));
}

return resolveSummary;
Expand Down

0 comments on commit 415ec31

Please sign in to comment.