示例#1
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        private IFLoadingBody CreateGravityLoad(GravityLoad gravityLoad, IFGeometry[] lusasGeometry)
        {
            IFLoadingBody lusasGravityLoad;
            IFLoadcase    assignedLoadcase = (IFLoadcase)d_LusasData.getLoadset(gravityLoad.Loadcase.AdapterId <int>(typeof(LusasId)));

            if (d_LusasData.existsAttribute("Loading", gravityLoad.Name))
            {
                lusasGravityLoad = (IFLoadingBody)d_LusasData.getAttributes("Loading", gravityLoad.Name);
            }
            else
            {
                lusasGravityLoad = d_LusasData.createLoadingBody(gravityLoad.Name);
                lusasGravityLoad.setBody(gravityLoad.GravityDirection.X, gravityLoad.GravityDirection.Y, gravityLoad.GravityDirection.Z);
            }

            IFAssignment lusasAssignment = m_LusasApplication.assignment();

            lusasAssignment.setLoadset(assignedLoadcase);
            lusasGravityLoad.assignTo(lusasGeometry, lusasAssignment);

            int adapterIdName = lusasGravityLoad.getID();

            gravityLoad.SetAdapterId(typeof(LusasId), adapterIdName);

            return(lusasGravityLoad);
        }
示例#2
0
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static GravityLoad ToGravityLoad(IFLoading lusasGravityLoad,
                                                IEnumerable <IFAssignment> lusasAssignments,
                                                Dictionary <string, Node> nodes,
                                                Dictionary <string, Bar> bars,
                                                Dictionary <string, Panel> panels)
        {
            IFLoadcase assignedLoadcase = (IFLoadcase)lusasAssignments.First().getAssignmentLoadset();
            Loadcase   loadcase         = ToLoadcase(assignedLoadcase);
            Vector     gravityVector    = new Vector
            {
                X = lusasGravityLoad.getValue("accX"),
                Y = lusasGravityLoad.getValue("accY"),
                Z = lusasGravityLoad.getValue("accZ")
            };

            IEnumerable <BHoMObject> assignedObjects = GetGeometryAssignments(
                lusasAssignments, nodes, bars, panels);
            GravityLoad gravityLoad = Engine.Structure.Create.GravityLoad(
                loadcase, gravityVector, assignedObjects, GetName(lusasGravityLoad));

            int adapterNameId = lusasGravityLoad.getID();

            gravityLoad.SetAdapterId(typeof(LusasId), adapterNameId);

            return(gravityLoad);
        }