Skip to content

Commit

Permalink
Added error message when trying to push loadcase with a negatve or ze…
Browse files Browse the repository at this point in the history
…ro number assigned (#533)
  • Loading branch information
peterjamesnugent authored Dec 19, 2023
2 parents aafb606 + 82c2db4 commit 9314fc7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Robot_Adapter/CRUD/Create/Loads/Loadcase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ private bool CreateCollection(IEnumerable<Loadcase> loadCase)

int subNature;
IRobotCaseNature rNature = Convert.ToRobotLoadcaseNature(caseList[i], out subNature);

// Check if any loadcases havea zero
if(caseList.Any(lc => lc.Number == 0 || lc.Number < 1))
{
Compute.RecordError("One or more Loadcases have a number zero (or negative number) assigned and cannot be pushed.");
return false;
}

m_RobotApplication.Project.Structure.Cases.CreateSimple(caseList[i].Number, caseList[i].Name, rNature, IRobotCaseAnalizeType.I_CAT_STATIC_LINEAR);
IRobotSimpleCase sCase = caseServer.Get(caseList[i].Number) as IRobotSimpleCase;

Expand Down

0 comments on commit 9314fc7

Please sign in to comment.