コード例 #1
0
ファイル: SurfaceProperty.cs プロジェクト: BHoM/RFEM_Toolkit
        /***************************************************/
        /**** Private methods                           ****/
        /***************************************************/

        private List <ISurfaceProperty> ReadSurfaceProperties(List <string> ids = null)
        {
            List <ISurfaceProperty> surfacePropList = new List <ISurfaceProperty>();


            if (ids == null)
            {
                foreach (rf.Surface surface in modelData.GetSurfaces())
                {
                    IMaterialFragment material = modelData.GetMaterial(surface.MaterialNo, rf.ItemAt.AtNo).GetData().FromRFEM();

                    rf.ISurface s = modelData.GetSurface(surface.No, rf.ItemAt.AtNo);
                    rf.IOrthotropicThickness ortho     = s.GetOrthotropicThickness();
                    rf.SurfaceStiffness      stiffness = ortho.GetData();

                    ISurfaceProperty surfaceProperty = stiffness.FromRFEM(material);


                    surfacePropList.Add(surfaceProperty);

                    /*
                     * int srfThickId = srfThickness.No;
                     * if (!m_sectionDict.ContainsKey(srfThickId))
                     * {
                     *  m_sectionDict.Add(srfThickId, srfProp);
                     * }
                     */
                }
            }
            else
            {
                foreach (string id in ids)
                {
                }
            }

            return(surfacePropList);
        }
コード例 #2
0
ファイル: Panel.cs プロジェクト: BHoM/RFEM_Toolkit
        /***************************************************/
        /**** Private methods                           ****/
        /***************************************************/

        private List <Panel> ReadPanels(List <string> ids = null)
        {
            List <Panel>     panelList = new List <Panel>();
            ISurfaceProperty surfaceProperty;

            if (ids == null)
            {
                foreach (rf.Surface surface in modelData.GetSurfaces())
                {
                    if (surface.GeometryType != rf.SurfaceGeometryType.PlaneSurfaceType)
                    {
                        Engine.Base.Compute.RecordError("Only plane surface types are supported at the moment");
                    }

                    List <Edge> edgeList = GetEdgesFromRFEMSurface(surface);

                    IMaterialFragment material = modelData.GetMaterial(surface.MaterialNo, rf.ItemAt.AtNo).GetData().FromRFEM();

                    if (surface.StiffnessType == rf.SurfaceStiffnessType.StandardStiffnessType)
                    {
                        surfaceProperty = new ConstantThickness {
                            Thickness = surface.Thickness.Constant, Material = material
                        };
                    }
                    else if (surface.StiffnessType == rf.SurfaceStiffnessType.OrthotropicStiffnessType)
                    {
                        rf.ISurface s = modelData.GetSurface(surface.No, rf.ItemAt.AtNo);
                        rf.IOrthotropicThickness ortho     = s.GetOrthotropicThickness();
                        rf.SurfaceStiffness      stiffness = ortho.GetData();
                        surfaceProperty = stiffness.FromRFEM(material);
                    }
                    else
                    {
                        surfaceProperty = null;
                        Engine.Base.Compute.RecordError("could not create surface property of type " + surface.StiffnessType.ToString());
                    }

                    List <Opening> openings = null;
                    Panel          panel    = Engine.Structure.Create.Panel(edgeList, openings, surfaceProperty);

                    panelList.Add(panel);
                }
            }
            else
            {
                foreach (string id in ids)
                {
                    rf.Surface surface = modelData.GetSurface(Int32.Parse(id), rf.ItemAt.AtNo).GetData();
                    if (surface.GeometryType != rf.SurfaceGeometryType.PlaneSurfaceType)
                    {
                        Engine.Base.Compute.RecordError("Only plane surface types are supported at the moment");
                    }

                    List <Edge> edgeList = GetEdgesFromRFEMSurface(surface);

                    IMaterialFragment material = modelData.GetMaterial(surface.MaterialNo, rf.ItemAt.AtNo).GetData().FromRFEM();

                    rf.ISurface s = modelData.GetSurface(surface.No, rf.ItemAt.AtNo);
                    rf.IOrthotropicThickness ortho     = s.GetOrthotropicThickness();
                    rf.SurfaceStiffness      stiffness = ortho.GetData();

                    surfaceProperty = stiffness.FromRFEM(material);

                    List <Opening> openings = null;
                    Panel          panel    = Engine.Structure.Create.Panel(edgeList, openings, surfaceProperty);

                    panelList.Add(panel);
                }
            }

            return(panelList);
        }