// LoadPoint /// <summary> /// Returns the distributed load assignments to objects. /// </summary> /// <param name="app">The application.</param> /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception> public void GetLoadPoint(CSiApplication app) { // TODO: Add to API project? app.Model.ObjectModel.FrameObject.GetLoadPoint(Name, out var names, out var loadPatterns, out var forceTypes, out var loadDirections, out var pointLoadValues, out var absoluteDistanceFromI, out var relativeDistanceFromI, out var coordinateSystems); for (int i = 0; i < names.Length; i++) { FrameLoadPoint pointLoad = new FrameLoadPoint { LoadPattern = loadPatterns[i], ForceType = forceTypes[i], LoadDirection = loadDirections[i], PointLoadValue = pointLoadValues[i], AbsoluteDistanceFromI = absoluteDistanceFromI[i], RelativeDistanceFromI = relativeDistanceFromI[i], CoordinateSystem = coordinateSystems[i], }; PointLoads.Add(pointLoad); } }
/// <summary> /// Assigns point loads to objects. /// </summary> /// <param name="app">The application.</param> /// <param name="pointLoad">The point load.</param> /// <param name="replace">True: All previous uniform loads, if any, assigned to the specified object(s), in the specified load pattern, are deleted before making the new assignment.</param> /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception> public void SetLoadPoint(CSiApplication app, FrameLoadPoint pointLoad, bool replace = true) { // TODO: Add to API project? // TODO: For load, ensure that absolute distance values are always created, even if relative values are used. app.Model.ObjectModel.FrameObject.SetLoadPoint(Name, pointLoad.LoadPattern, pointLoad.ForceType, pointLoad.LoadDirection, pointLoad.PointLoadValue, pointLoad.AbsoluteDistanceFromI, distanceIsRelative: false, coordinateSystem: pointLoad.CoordinateSystem, replace: true); }
/// <summary> /// Sets the frame loads point. /// </summary> /// <param name="model">The model.</param> /// <param name="table">The table.</param> private static void setFRAME_LOADS_POINT(Model model, List <Dictionary <string, string> > table) { foreach (Dictionary <string, string> tableRow in table) { Frame frame = model.Structure.Frames[tableRow["Frame"]]; RelativeAbsoluteCoordinate distanceFromI = new RelativeAbsoluteCoordinate(frame.Length) { UseRelativeDistance = (tableRow["DistType"] == "RelDist") }; if (distanceFromI.UseRelativeDistance) { distanceFromI.RelativeDistance = Adaptor.toDouble(tableRow["RelDist"]); } else { distanceFromI.ActualDistance = Adaptor.toDouble(tableRow["AbsDist"]); } FrameLoadPoint load = new FrameLoadPoint { LoadPattern = tableRow["LoadPat"], CoordinateSystem = tableRow["CoordSys"], ForceType = Enums.EnumLibrary.ConvertStringToEnumByDescription <eLoadForceType>(tableRow["Type"]), LoadDirection = Enums.EnumLibrary.ConvertStringToEnumByDescription <eLoadDirection>(tableRow["Dir"]), DistanceFromI = distanceFromI, GUID = tableRow["GUID"], }; if (tableRow.ContainsKey("Force")) { load.PointLoadValue = Adaptor.toDouble(tableRow["Force"]); } if (tableRow.ContainsKey("Moment")) { load.PointLoadValue = Adaptor.toDouble(tableRow["Moment"]); } frame.AddLoadPoint(load); } }