protected override void SolveInstance(IGH_DataAccess DA) { Curve curve = null; Motions motions = null; Rotations rotations = null; MotionsPlasticLimits motionsPlasticLimit = null; RotationsPlasticLimits rotationsPlasticLimit = null; bool movingLocal = false; if (!DA.GetData(0, ref curve)) { return; } if (!DA.GetData(1, ref motions)) { return; } if (!DA.GetData(2, ref rotations)) { return; } DA.GetData(3, ref motionsPlasticLimit); DA.GetData(4, ref rotationsPlasticLimit); DA.GetData(5, ref movingLocal); Vector3d v = Vector3d.Zero; DA.GetData(6, ref v); bool orientLCS = true; DA.GetData(7, ref orientLCS); string identifier = "S"; DA.GetData(8, ref identifier); if (curve == null || identifier == null) { return; } Geometry.Edge edge = Convert.FromRhinoLineOrArc1(curve); var obj = new Supports.LineSupport(edge, motions, motionsPlasticLimit, rotations, rotationsPlasticLimit, movingLocal, identifier); // Set local y-axis if (!v.Equals(Vector3d.Zero)) { obj.Group.LocalY = v.FromRhino(); } else // Orient coordinate system to GCS { if (orientLCS) { obj.Group.OrientCoordinateSystemToGCS(); } } DA.SetData(0, obj); }
public static LineSupport Define(Autodesk.DesignScript.Geometry.Curve curve, Motions motions, [DefaultArgument("MotionsPlasticLimits.Default()")] MotionsPlasticLimits motionsPlasticLimits, Rotations rotations, [DefaultArgument("RotationsPlasticLimits.Default()")] RotationsPlasticLimits rotationsPlasticLimits, [DefaultArgument("false")] bool movingLocal, [DefaultArgument("Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0,0,0)")] Autodesk.DesignScript.Geometry.Vector localY, [DefaultArgument("true")] bool orientLCS, [DefaultArgument("S")] string identifier) { Geometry.Edge edge = Geometry.Edge.FromDynamoLineOrArc1(curve); FemDesign.Supports.LineSupport obj = new LineSupport(edge, motions, motionsPlasticLimits, rotations, rotationsPlasticLimits, movingLocal, identifier); // set local y-axis if (!localY.Equals(Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 0))) { obj.Group.LocalY = FemDesign.Geometry.FdVector3d.FromDynamo(localY); } // else orient coordinate system to GCS else { if (orientLCS) { obj.Group.OrientCoordinateSystemToGCS(); } } return(obj); }
public static PointSupport Define(Autodesk.DesignScript.Geometry.Point point, Motions motions, [DefaultArgument("MotionsPlasticLimits.Default()")] MotionsPlasticLimits motionsPlasticLimits, Rotations rotations, [DefaultArgument("RotationsPlasticLimits.Default()")] RotationsPlasticLimits rotationsPlasticLimits, [DefaultArgument("S")] string identifier) { return(new PointSupport(Geometry.FdPoint3d.FromDynamo(point), motions, motionsPlasticLimits, rotations, rotationsPlasticLimits, identifier)); }
/// <summary> /// Constructor by edge and rigidity. Used to create group for point support /// </summary> internal Group(Geometry.FdVector3d localX, Geometry.FdVector3d localY, Motions motions, MotionsPlasticLimits motionsPlasticLimits, Rotations rotations, RotationsPlasticLimits rotationsPlasticLimits) { this._localX = localX; this._localY = localY; this.Rigidity = new RigidityDataType3(motions, motionsPlasticLimits, rotations, rotationsPlasticLimits); }
/// <summary> /// Constructor by edge and rigidity. Used to create group for line support /// </summary> internal Group(Geometry.FdCoordinateSystem coordSystem, Motions motions, MotionsPlasticLimits motionsPlasticLimits, Rotations rotations, RotationsPlasticLimits rotationsPlasticLimits) { this.CoordinateSystem = coordSystem; this.Rigidity = new RigidityDataType3(motions, motionsPlasticLimits, rotations, rotationsPlasticLimits); }
/// <summary> /// Create a connected point between 2 points with rigidity (motions, rotations) and plastic limits (forces, moments). /// </summary> public ConnectedPoints(FdPoint3d firstPoint, FdPoint3d secondPoint, Motions motions, MotionsPlasticLimits motionsPlasticLimits, Rotations rotations, RotationsPlasticLimits rotationsPlasticLimits, GuidListType[] references, string identifier = "CP") { RigidityDataType2 rigidity = new RigidityDataType2(motions, motionsPlasticLimits, rotations, rotationsPlasticLimits); Initialize(firstPoint, secondPoint, rigidity, references, identifier); }
/// <summary> /// Create a connected point between 2 points with rigidity (motions, rotations) and plastic limits (forces, moments). /// </summary> public ConnectedPoints(FdPoint3d firstPoint, FdPoint3d secondPoint, Motions motions, MotionsPlasticLimits motionsPlasticLimits, Rotations rotations, RotationsPlasticLimits rotationsPlasticLimits, IEnumerable <EntityBase> references, string identifier = "CP") { GuidListType[] refs = references.Select(r => new GuidListType(r)).ToArray(); RigidityDataType2 rigidity = new RigidityDataType2(motions, motionsPlasticLimits, rotations, rotationsPlasticLimits); Initialize(firstPoint, secondPoint, rigidity, refs, identifier); }