Skip to content

Commit

Permalink
Fix on 'Revit Issue' component.
Browse files Browse the repository at this point in the history
  • Loading branch information
kike-garbo committed May 3, 2024
1 parent 6dd0062 commit d09eb3e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/RhinoInside.Revit.GH/Components/Sheets/AddRevision.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
update |= Params.GetData(DA, "Issued To", out string issuedTo);
update |= Params.GetData(DA, "Issued", out bool? issued);

if (update) Invoke(this, revision.Value, date, description, issuedBy, issuedTo, issued);
if (update && !Invoke(this, revision.Value, date, description, issuedBy, issuedTo, issued)) return;

Params.TrySetData(DA, "Revision", () => revision);

Expand All @@ -246,7 +246,7 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
Params.TrySetData(DA, "Issued", () => revision.Issued);
}

internal static void Invoke(TransactionalChainComponent component, ARDB.Revision revision, string date, string description, string issuedBy, string issuedTo, bool? issued)
internal static bool Invoke(TransactionalChainComponent component, ARDB.Revision revision, string date, string description, string issuedBy, string issuedTo, bool? issued)
{
var updateDate = date is object && revision.RevisionDate != date;
var updateDescription = description is object && revision.Description != description;
Expand All @@ -270,7 +270,7 @@ internal static void Invoke(TransactionalChainComponent component, ARDB.Revision
if (updateDescription) component.AddContinuableFailure($"Can't set 'Revision Description' parameter. Revision '{revision.Description}' is already issued. {{{revision.Id}}}");
if (updateIssuedBy) component.AddContinuableFailure($"Can't set 'Issued By' parameter. Revision '{revision.Description}' is already issued. {{{revision.Id}}}");
if (updateIssuedTo) component.AddContinuableFailure($"Can't set 'Issued To' parameter. Revision '{revision.Description}' is already issued. {{{revision.Id}}}");
return;
return false;

case ARDB.FailureProcessingResult.ProceedWithCommit:
revision.Issued = false;
Expand All @@ -297,7 +297,8 @@ internal static void Invoke(TransactionalChainComponent component, ARDB.Revision
if (updateIssuedTo) revision.IssuedTo = issuedTo;
if (updateIssued) revision.Issued = issued.Value;
}

return true;
}
}

}

0 comments on commit d09eb3e

Please sign in to comment.