Skip to content

Missing error message when pushing load type that is not implemented in Lusas. #385

@KalleEdstroem

Description

@KalleEdstroem

Description:

  • When pushing a load type that is not implemented an error message regarding Null property is presented to the user.
  • It is (for the user) unclear why that error arises.
  • It would simplify if an error stating that the load type is not implemented for pushing to Lusas.

How to fix:

  • When the method determines the load type it could default to a message telling the user if it is not implemented.

Add this line in the end of the loadType case checks.
Engine.Base.Compute.RecordError("Load type is not supported in the Lusas_Toolkit.");

Question is if it should be worded as not supported or not implemented.

switch (loadType)
{
case "BH.oM.Structure.Loads.PointLoad":
success = CreateCollection(objects as IEnumerable<PointLoad>);
break;
case "BH.oM.Structure.Loads.GravityLoad":
success = CreateCollection(objects as IEnumerable<GravityLoad>);
break;
case "BH.oM.Structure.Loads.BarUniformlyDistributedLoad":
success = CreateCollection(objects as IEnumerable<BarUniformlyDistributedLoad>);
break;
case "BH.oM.Structure.Loads.AreaUniformlyDistributedLoad":
success = CreateCollection(objects as IEnumerable<AreaUniformlyDistributedLoad>);
break;
case "BH.oM.Structure.Loads.BarUniformTemperatureLoad":
success = CreateCollection(objects as IEnumerable<BarUniformTemperatureLoad>);
break;
case "BH.oM.Structure.Loads.AreaUniformTemperatureLoad":
success = CreateCollection(objects as IEnumerable<AreaUniformTemperatureLoad>);
break;
case "BH.oM.Structure.Loads.PointDisplacement":
success = CreateCollection(objects as IEnumerable<PointDisplacement>);
break;
case "BH.oM.Structure.Loads.BarPointLoad":
success = CreateCollection(objects as IEnumerable<BarPointLoad>);
break;
case "BH.oM.Structure.Loads.BarVaryingDistributedLoad":
success = CreateCollection(objects as IEnumerable<BarVaryingDistributedLoad>);
break;

Test script:

https://burohappold.sharepoint.com/:u:/r/sites/BHoM/02_Current/12_Scripts/01_Issue/BHoM/Lusas_Toolkit/%23385%20Error%20message%20for%20unsupported%20loadtypes%20.gh?csf=1&web=1&e=BUncCR

Additional info:

The load types (BHoM Type) not supported according to the wiki on Lusas_Toolkit: PointAcceleration, PointVelocity, BarPrestressLoad, ContourLoad and GeometricalLineLoad.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions