Skip to content

Commit

Permalink
Cantilever functionality resolved per directionality
Browse files Browse the repository at this point in the history
  • Loading branch information
enarhi committed Sep 13, 2019
1 parent fe1349f commit 6a06368
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions RAM_Adapter/CRUD/Create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private bool CreateCollection(IEnumerable<Bar> bhomBars)
bar.CustomData.TryGetValue("EndCantilever", out endCantObj);
double startCant, endCant;
double.TryParse(startCantObj == null ? "" : startCantObj.ToString(), out startCant);
double.TryParse(endCantObj == null ? "" : startCantObj.ToString(), out endCant);
double.TryParse(endCantObj == null ? "" : endCantObj.ToString(), out endCant);

if (isStubCant.Equals("True") || isStubCant.Equals("1")) //Check bool per RAM or GH preferred boolean context
{
Expand All @@ -134,6 +134,8 @@ private bool CreateCollection(IEnumerable<Bar> bhomBars)
startPt = bar.StartNode.Position();
endPt = bar.EndNode.Position();
}


double xStart = startPt.X;
double yStart = startPt.Y;
double xEnd = endPt.X;
Expand All @@ -149,8 +151,16 @@ private bool CreateCollection(IEnumerable<Bar> bhomBars)
Point endSupPt = BH.Engine.Geometry.Modify.Translate(bar.EndNode.Position(), -barDir * endCant);

ramBeam = ramBeams.Add(bar.SectionProperty.Material.ToRAM(), startSupPt.X, startSupPt.Y, 0, endSupPt.X, endSupPt.Y, 0); // No Z offsets, beams flat on closest story
ramBeam.dStartCantilever = startCant;
ramBeam.dEndCantilever = endCant;
if (startSupPt.X < endSupPt.X || (startSupPt.X == endSupPt.X && startSupPt.Y>endSupPt.Y))
{
ramBeam.dStartCantilever = startCant;
ramBeam.dEndCantilever = endCant;
}
else
{
ramBeam.dStartCantilever = endCant;
ramBeam.dEndCantilever = startCant;
}
}

// Add warning to report distance of snapping to level as required for RAM
Expand Down
2 changes: 1 addition & 1 deletion RAM_Engine/Convert/ToRAM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static IStory GetStory(this Bar bar, StructuralUsage1D usage1D, IStories
bar.CustomData.TryGetValue("IsHangingColumn", out isHanging);
isHanging = isHanging == null ? "" : isHanging.ToString();

if (isHanging == "True" || isHanging == "1") //Hanging Column to be placed on its btm level.
if (isHanging.Equals("True") || isHanging.Equals("1")) //Hanging Column to be placed on its btm level.
{
elev = Math.Min(bar.StartNode.Position().Z, bar.EndNode.Position().Z);
}
Expand Down

0 comments on commit 6a06368

Please sign in to comment.