Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug for LoadAxis on BarPointLoad and BarVaryingLoad #368

Merged
merged 6 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lusas_Adapter/CRUD/Create/Loads/BarDistributedLoad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ private List<IFLoadingBeamDistributed> CreateBarDistributedLoad(
axis = "projected";
if (barDistributedLoad.RelativePositions)
{
Engine.Base.Compute.RecordError("Projected loads with parametric distances are not supported in Lusas.");
Engine.Base.Compute.RecordError(barDistributedLoad.Name + " has not been pushed because the positions are relative and the loads " +
"are projected (this combination is not supported in Lusas).");
return null;
}
}
Expand Down
6 changes: 3 additions & 3 deletions Lusas_Adapter/Convert/ToBHoM/Loads/ToBarDistributedLoad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ public static BarVaryingDistributedLoad ToBarDistributedLoad(IFLoading lusasBarD
double endPosition = lusasBarDistributedLoad.getValue("endDistance");

bool relativePositions = lusasBarDistributedLoad.getValue("Type") == "Parametric" ? true : false;
LoadAxis axis = LoadAxis.Global;
bool projected = false;

BH.Engine.Base.Compute.RecordWarning("All BarVaryingDistributedLoads pulled from Lusas are assumed to be in global coordinates and to not be projected.");
string loadDirection = lusasBarDistributedLoad.getValue("LoadDirection");
bool projected = loadDirection == "Projected(beam)" ? true : false;
LoadAxis axis = loadDirection == "Local(beam)" ? LoadAxis.Local : LoadAxis.Global;

BarVaryingDistributedLoad barVarDistributedLoad;

Expand Down
4 changes: 3 additions & 1 deletion Lusas_Adapter/Convert/ToBHoM/Loads/ToBarPointLoad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ public static BarPointLoad ToBarPointLoad(IFLoading lusasBarPointLoad,

BarPointLoad barPointLoad;

LoadAxis loadAxis = lusasBarPointLoad.getValue("LoadDirection") == "Local(beam)" ? LoadAxis.Local : LoadAxis.Global;

barPointLoad = Engine.Structure.Create.BarPointLoad(
loadcase,
forcePosition,
assignedBars,
forceVector,
momentVector,
LoadAxis.Global,
loadAxis,
GetName(lusasBarPointLoad));

long adapterNameId = lusasBarPointLoad.getID();
Expand Down