/***************************************************/ public static Bar SetInsertionPoint(this Bar bar, BarInsertionPoint barInsertionPoint = BarInsertionPoint.Centroid, bool modifyStiffness = true) { return((Bar)bar.AddFragment(new InsertionPoint() { BarInsertionPoint = barInsertionPoint, ModifyStiffness = modifyStiffness }, true)); }
/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static Bar SetInsertionPoint(this Bar bar, BarInsertionPoint barInsertionPoint = BarInsertionPoint.Centroid) { Bar clone = (Bar)bar.GetShallowClone(); clone.CustomData["EtabsInsertionPoint"] = barInsertionPoint; return(clone); }
/***************************************************/ private static void FlipInsertionPoint(Bar bar) { InsertionPoint fragment = bar.FindFragment <InsertionPoint>(); if (fragment != null) { BarInsertionPoint insertionPoint = fragment.BarInsertionPoint; switch (insertionPoint) { case BarInsertionPoint.BottomLeft: fragment.BarInsertionPoint = BarInsertionPoint.BottomRight; break; case BarInsertionPoint.BottomRight: fragment.BarInsertionPoint = BarInsertionPoint.BottomLeft; break; case BarInsertionPoint.MiddleLeft: fragment.BarInsertionPoint = BarInsertionPoint.MiddleRight; break; case BarInsertionPoint.MiddleRight: fragment.BarInsertionPoint = BarInsertionPoint.MiddleLeft; break; case BarInsertionPoint.TopLeft: fragment.BarInsertionPoint = BarInsertionPoint.TopRight; break; case BarInsertionPoint.TopRight: fragment.BarInsertionPoint = BarInsertionPoint.TopLeft; break; default: break; } bar.Fragments.AddOrReplace(fragment); } }
/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static Bar SetInsertionPoint(this Bar bar, BarInsertionPoint barInsertionPoint = BarInsertionPoint.Centroid) { return(bar.SetInsertionPoint(barInsertionPoint, true)); }
public static bool BarModifyStiffnessInsertionPoint(this Bar bar) { BarInsertionPoint o = bar?.FindFragment <BarInsertionPoint>(); return(o == null ? true : o.ModifyStiffness); }
public static BarInsertionPointLocation BarInsertionPoint(this Bar bar) { BarInsertionPoint o = bar?.FindFragment <BarInsertionPoint>(); return(o == null ? BarInsertionPointLocation.Centroid : o.InsertionPoint); }