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

Update FlipBar method to use core method #486

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all 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
52 changes: 1 addition & 51 deletions Etabs_Adapter/CRUD/Create/Bar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private bool CreateObject(Bar bhBar)
// Evaluate if the bar is alinged as Etabs wants it
if (bhBar.CheckFlipBar())
{
FlipEndPoints(bhBar); //CloneBeforePush means this is fine
BH.Engine.Structure.Modify.Flip(bhBar); //CloneBeforePush means this is fine
FlipInsertionPoint(bhBar); //ETABS specific operation
Engine.Base.Compute.RecordNote("Some bars has been flipped to comply with ETABS API, asymmetric sections will suffer");
}
Expand Down Expand Up @@ -204,56 +204,6 @@ private bool SetObject(Bar bhBar)

#if Debug16 || Release16

[Description("Returns a bar where the endpoints have been flipped without cloning the object")]
private static void FlipEndPoints(Bar bar)
{
// Flip the endpoints
Node tempNode = bar.Start;
bar.Start = bar.End;
bar.End = tempNode;

// Flip orientationAngle
bar.OrientationAngle = -bar.OrientationAngle;
if (bar.IsVertical())
bar.OrientationAngle += Math.PI;

// Flip Offsets
if (bar.Offset != null)
{
Vector tempV = bar.Offset.Start;
bar.Offset.Start = bar.Offset.End;
bar.Offset.End = tempV;

if(bar.Offset.Start != null)
bar.Offset.Start.X *= -1;

if(bar.Offset.End != null)
bar.Offset.End.X *= -1;

if (!bar.IsVertical())
{
if(bar.Offset.Start != null)
bar.Offset.Start.Y *= -1;

if(bar.Offset.End != null)
bar.Offset.End.Y *= -1;
}
}
// mirror the section
// not possible to push to ETABS afterwards if we did
// warning for asymetric sections?

// Flip Release
if (bar.Release != null)
{
Constraint6DOF tempC = bar.Release.StartRelease;
bar.Release.StartRelease = bar.Release.EndRelease;
bar.Release.EndRelease = tempC;
}
}

/***************************************************/

private static void FlipInsertionPoint(Bar bar)
{
InsertionPoint fragment = bar.FindFragment<InsertionPoint>();
Expand Down
Loading