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

Structure_Engine: Added an additional Create Method for GeometricalLineLoad #3213

35 changes: 35 additions & 0 deletions Structure_Engine/Create/Loads/GeometricalLineLoad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,41 @@ public static GeometricalLineLoad GeometricalLineLoad(Line location, Loadcase lo
};
}

[Description("Creates a GeometricalLineLoad with a constant force across the length of the Line.")]
[InputFromProperty("location")]
[InputFromProperty("loadcase")]
[Input("force", "The force to be applied to the full length of the Line.", typeof(BH.oM.Quantities.Attributes.Force))]
[Input("moment", "The momentto be applied to the full length of the Line.", typeof(BH.oM.Quantities.Attributes.Moment))]
[Input("objects", "The IAreaElement (i.e. Panels or FEMesh) to apply the GeometricalLineLoad to.")]
[Input("name", "The name of the created load.")]
Arne-Martensen marked this conversation as resolved.
Show resolved Hide resolved
[Output("geoLineLoad", "The created GeometricalLineLoad.")]
public static GeometricalLineLoad GeometricalLineLoad(Line location, Loadcase loadcase, Vector force= null, Vector moment= null, IEnumerable<IAreaElement> objects = null, string name = "")
{
BHoMGroup<IAreaElement> group = new BHoMGroup<IAreaElement>();
if (objects == null)
group = null;
else
group.Elements = objects.ToList();

Arne-Martensen marked this conversation as resolved.
Show resolved Hide resolved
if(force == null)
force = new Vector();

if(moment == null)
moment = new Vector();

Arne-Martensen marked this conversation as resolved.
Show resolved Hide resolved
return new GeometricalLineLoad
{
Location = location,
Loadcase = loadcase,
ForceA = force,
ForceB = force,
MomentA = moment,
MomentB = moment,
Name = name,
Objects = group
};
}

/***************************************************/
/**** Public Methods - ToBeRemoved ****/
/***************************************************/
Expand Down