コード例 #1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            double diameter = 0;

            FemDesign.Materials.Material material = null;
            string profile = "ribbed";

            if (!DA.GetData("Diameter", ref diameter))
            {
                return;
            }
            if (!DA.GetData("Material", ref material))
            {
                return;
            }
            DA.GetData("Profile", ref profile);

            if (material == null || profile == null)
            {
                return;
            }

            WireProfileType _profile = EnumParser.Parse <WireProfileType>(profile);

            FemDesign.Reinforcement.Wire obj = new FemDesign.Reinforcement.Wire(diameter, material, _profile);

            DA.SetData(0, obj);
        }
コード例 #2
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input
            FemDesign.Materials.Material material = null;
            double creepUls  = 0;
            double creepSlq  = 0;
            double creepSlf  = 0;
            double creepSlc  = 0;
            double shrinkage = 0;

            if (!DA.GetData(0, ref material))
            {
                return;
            }
            if (!DA.GetData(1, ref creepUls))
            {
                // pass
            }
            if (!DA.GetData(2, ref creepSlq))
            {
                // pass
            }
            if (!DA.GetData(3, ref creepSlf))
            {
                // pass
            }
            if (!DA.GetData(4, ref creepSlc))
            {
                // pass
            }
            if (!DA.GetData(5, ref shrinkage))
            {
                // pass
            }
            if (material == null)
            {
                return;
            }

            //
            FemDesign.Materials.Material modifiedMaterial = FemDesign.Materials.Material.ConcreteMaterialProperties(material, creepUls, creepSlq, creepSlf, creepSlc, shrinkage);
            modifiedMaterial.EntityModified();

            // set output
            DA.SetData(0, modifiedMaterial);
        }
コード例 #3
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            FemDesign.Materials.MaterialDatabase materialDatabase = null;
            string materialName = null;

            if (!DA.GetData(0, ref materialDatabase))
            {
                return;
            }
            if (!DA.GetData(1, ref materialName))
            {
                return;
            }
            if (materialDatabase == null || materialName == null)
            {
                return;
            }

            FemDesign.Materials.Material material = materialDatabase.MaterialByName(materialName);

            DA.SetData(0, material);
        }
コード例 #4
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input

            Curve curve = null;

            if (!DA.GetData(0, ref curve))
            {
                return;
            }

            FemDesign.Materials.Material material = null;
            if (!DA.GetData(1, ref material))
            {
                material = FemDesign.Materials.MaterialDatabase.GetDefault().MaterialByName("C30/37");
            }

            FemDesign.Sections.Section section = null;
            if (!DA.GetData(2, ref section))
            {
                section = FemDesign.Sections.SectionDatabase.GetDefault().SectionByName("Concrete sections, Rectangle, 250x600");
            }

            Vector3d v = Vector3d.Zero;

            if (!DA.GetData(3, ref v))
            {
                // pass
            }

            bool orientLCS = true;

            if (!DA.GetData(4, ref orientLCS))
            {
                // pass
            }

            string identifier = "T";

            if (!DA.GetData(5, ref identifier))
            {
                // pass
            }

            // convert geometry
            if (curve.GetType() != typeof(LineCurve))
            {
                throw new System.ArgumentException("Curve must be a LineCurve");
            }
            FemDesign.Geometry.Edge edge = Convert.FromRhinoLineCurve((LineCurve)curve);

            // bar
            var type = FemDesign.Bars.BarType.Truss;

            FemDesign.Bars.Bar bar = new FemDesign.Bars.Bar(edge, type, material, section, identifier);

            // set local y-axis
            if (!v.Equals(Vector3d.Zero))
            {
                bar.BarPart.LocalY = v.FromRhino();
            }

            // else orient coordinate system to GCS
            else
            {
                if (orientLCS)
                {
                    bar.BarPart.OrientCoordinateSystemToGCS();
                }
            }

            // return
            DA.SetData(0, bar);
        }
コード例 #5
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input
            Brep surface = null;

            if (!DA.GetData(0, ref surface))
            {
                return;
            }

            double thickness = 0;

            if (!DA.GetData(1, ref thickness))
            {
                return;
            }

            FemDesign.Materials.Material material = null;
            if (!DA.GetData(2, ref material))
            {
                return;
            }

            FemDesign.Shells.ShellEccentricity eccentricity = FemDesign.Shells.ShellEccentricity.GetDefault();
            if (!DA.GetData(3, ref eccentricity))
            {
                // pass
            }

            FemDesign.Shells.ShellOrthotropy orthotropy = FemDesign.Shells.ShellOrthotropy.GetDefault();
            if (!DA.GetData(4, ref orthotropy))
            {
                // pass
            }

            FemDesign.Shells.EdgeConnection edgeConnection = FemDesign.Shells.EdgeConnection.GetRigid();
            if (!DA.GetData(5, ref edgeConnection))
            {
                // pass
            }

            Rhino.Geometry.Vector3d x = Vector3d.Zero;
            if (!DA.GetData(6, ref x))
            {
                // pass
            }

            Rhino.Geometry.Vector3d z = Vector3d.Zero;
            if (!DA.GetData(7, ref z))
            {
                // pass
            }

            string identifier = "P";

            if (!DA.GetData(8, ref identifier))
            {
                // pass
            }

            if (surface == null || material == null || eccentricity == null || orthotropy == null || edgeConnection == null || identifier == null)
            {
                return;
            }

            //
            FemDesign.Geometry.Region region = surface.FromRhino();

            //
            List <FemDesign.Shells.Thickness> thicknessObj = new List <FemDesign.Shells.Thickness>();

            thicknessObj.Add(new FemDesign.Shells.Thickness(region.CoordinateSystem.Origin, thickness));

            //
            FemDesign.Shells.Slab obj = FemDesign.Shells.Slab.Plate(identifier, material, region, edgeConnection, eccentricity, orthotropy, thicknessObj);

            // set local x-axis
            if (!x.Equals(Vector3d.Zero))
            {
                obj.SlabPart.LocalX = x.FromRhino();
            }

            // set local z-axis
            if (!z.Equals(Vector3d.Zero))
            {
                obj.SlabPart.LocalZ = z.FromRhino();
            }

            // return
            DA.SetData(0, obj);
        }
コード例 #6
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input
            Bars.Bar bar = null;
            if (DA.GetData(0, ref bar))
            {
                if (bar.BarPart.HasComplexCompositeRef || bar.BarPart.HasDeltaBeamComplexSectionRef)
                {
                    AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "The bar has a Composite Section. The object has not been implemented yet. Please, get in touch if needed.");
                    return;
                }

                bar = bar.DeepClone();
            }

            bool newGuid = false;

            if (DA.GetData(1, ref newGuid))
            {
                if (newGuid)
                {
                    bar.EntityCreated();
                    bar.BarPart.EntityCreated();
                }
            }

            Curve curve = null;

            if (DA.GetData(2, ref curve))
            {
                // convert geometry
                FemDesign.Geometry.Edge edge = Convert.FromRhinoLineOrArc2(curve);

                // update edge
                bar.BarPart.Edge = edge;
            }

            FemDesign.Materials.Material material = null;
            if (DA.GetData(3, ref material))
            {
                bar.BarPart.ComplexMaterialObj = material;
            }

            List <FemDesign.Sections.Section> sections = new List <Sections.Section>();

            if (DA.GetDataList(4, sections))
            {
                bar.BarPart.ComplexSectionObj.Sections = sections.ToArray();
            }

            List <FemDesign.Bars.Connectivity> connectivities = new List <Bars.Connectivity>();

            if (DA.GetDataList(5, connectivities))
            {
                bar.BarPart.Connectivity = connectivities.ToArray();
            }

            List <FemDesign.Bars.Eccentricity> eccentricities = new List <Bars.Eccentricity>();

            if (DA.GetDataList(6, eccentricities))
            {
                if (bar.Type != Bars.BarType.Truss)
                {
                    bar.BarPart.ComplexSectionObj.Eccentricities = eccentricities.ToArray();
                }
            }

            Vector3d v = Vector3d.Zero;

            if (DA.GetData(7, ref v))
            {
                bar.BarPart.LocalY = v.FromRhino();
            }

            bool orientLCS = true;

            if (DA.GetData(8, ref orientLCS))
            {
                bar.BarPart.OrientCoordinateSystemToGCS();
            }

            string identifier = null;

            if (DA.GetData(9, ref identifier))
            {
                bar.Identifier         = identifier;
                bar.BarPart.Identifier = bar.Identifier;
            }

            // output
            DA.SetData(0, bar);
        }
コード例 #7
0
ファイル: BarsBeam.cs プロジェクト: strusoft/femdesign-api
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input
            Curve curve = null;

            if (!DA.GetData(0, ref curve))
            {
                return;
            }

            FemDesign.Materials.Material material = null;
            if (!DA.GetData(1, ref material))
            {
                material = FemDesign.Materials.MaterialDatabase.GetDefault().MaterialByName("C30/37");
            }

            List <FemDesign.Sections.Section> sections = new List <Sections.Section>();

            if (!DA.GetDataList(2, sections))
            {
                sections = new List <Sections.Section>();
                sections.Add(FemDesign.Sections.SectionDatabase.GetDefault().SectionByName("Concrete sections, Rectangle, 250x600"));
            }

            List <FemDesign.Bars.Connectivity> connectivities = new List <Bars.Connectivity>();

            if (!DA.GetDataList(3, connectivities))
            {
                connectivities = new List <Bars.Connectivity> {
                    FemDesign.Bars.Connectivity.GetRigid()
                };
            }

            List <FemDesign.Bars.Eccentricity> eccentricities = new List <Bars.Eccentricity>();

            if (!DA.GetDataList(4, eccentricities))
            {
                eccentricities = new List <Bars.Eccentricity> {
                    FemDesign.Bars.Eccentricity.GetDefault()
                };
            }

            Vector3d v = Vector3d.Zero;

            if (!DA.GetData(5, ref v))
            {
                // pass
            }

            bool orientLCS = true;

            if (!DA.GetData(6, ref orientLCS))
            {
                // pass
            }

            string identifier = "B";

            if (!DA.GetData(7, ref identifier))
            {
                // pass
            }


            // convert geometry
            FemDesign.Geometry.Edge edge = Convert.FromRhinoLineOrArc2(curve);

            // create bar
            var type = FemDesign.Bars.BarType.Beam;

            FemDesign.Bars.Bar bar = new FemDesign.Bars.Bar(edge, type, material, sections.ToArray(), eccentricities.ToArray(), connectivities.ToArray(), identifier);

            // set local y-axis
            if (!v.Equals(Vector3d.Zero))
            {
                bar.BarPart.LocalY = v.FromRhino();
            }

            // else orient coordinate system to GCS
            else
            {
                if (orientLCS)
                {
                    bar.BarPart.OrientCoordinateSystemToGCS();
                }
            }

            // output
            DA.SetData(0, bar);
        }
コード例 #8
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input

            Brep surface = null;

            if (!DA.GetData(0, ref surface))
            {
                return;
            }

            List <FemDesign.Shells.Thickness> thickness = new List <FemDesign.Shells.Thickness>();

            if (!DA.GetDataList(1, thickness))
            {
                return;
            }

            FemDesign.Materials.Material material = null;
            if (!DA.GetData(2, ref material))
            {
                return;
            }

            FemDesign.Shells.ShellEccentricity eccentricity = FemDesign.Shells.ShellEccentricity.GetDefault();
            if (!DA.GetData(3, ref eccentricity))
            {
                // pass
            }

            FemDesign.Shells.ShellOrthotropy orthotropy = FemDesign.Shells.ShellOrthotropy.GetDefault();
            if (!DA.GetData(4, ref orthotropy))
            {
                // pass
            }

            FemDesign.Shells.EdgeConnection edgeConnection = FemDesign.Shells.EdgeConnection.GetRigid();
            if (!DA.GetData(5, ref edgeConnection))
            {
                // pass
            }

            Rhino.Geometry.Vector3d x = Vector3d.Zero;
            if (!DA.GetData(6, ref x))
            {
                // pass
            }

            Rhino.Geometry.Vector3d z = Vector3d.Zero;
            if (!DA.GetData(7, ref z))
            {
                // pass
            }

            string identifier = "W";

            if (!DA.GetData(8, ref identifier))
            {
                // pass
            }
            if (surface == null || thickness == null || material == null || eccentricity == null || orthotropy == null || edgeConnection == null)
            {
                return;
            }
            if (thickness.Count != 2)
            {
                throw new System.ArgumentException("Thickness must contain exactly 2 items.");
            }

            // convert geometry
            FemDesign.Geometry.Region region = surface.FromRhino();

            //
            FemDesign.Shells.Slab obj = FemDesign.Shells.Slab.Wall(identifier, material, region, edgeConnection, eccentricity, orthotropy, thickness);

            // set local x-axis
            if (!x.Equals(Vector3d.Zero))
            {
                obj.SlabPart.LocalX = x.FromRhino();
            }

            // set local z-axis
            if (!z.Equals(Vector3d.Zero))
            {
                obj.SlabPart.LocalZ = z.FromRhino();
            }

            // return
            DA.SetData(0, obj);
        }
コード例 #9
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input
            Curve curve = null;

            if (!DA.GetData(0, ref curve))
            {
                return;
            }

            FemDesign.Materials.Material material = null;
            if (!DA.GetData(1, ref material))
            {
                return;
            }

            FemDesign.Sections.Section section = null;
            if (!DA.GetData(2, ref section))
            {
                return;
            }

            double maxCompression = 0;

            if (!DA.GetData(3, ref maxCompression))
            {
                return;
            }

            bool compressionPlasticity = false;

            if (!DA.GetData(4, ref compressionPlasticity))
            {
                return;
            }

            double maxTension = 0;

            if (!DA.GetData(5, ref maxTension))
            {
                return;
            }

            bool tensionPlasticity = false;

            if (!DA.GetData(6, ref tensionPlasticity))
            {
                return;
            }

            Vector3d v = Vector3d.Zero;

            if (!DA.GetData(7, ref v))
            {
                // pass
            }

            bool orientLCS = true;

            if (!DA.GetData(8, ref orientLCS))
            {
                // pass
            }

            string identifier = "T";

            if (!DA.GetData(9, ref identifier))
            {
                // pass
            }
            if (curve == null || material == null || section == null || identifier == null)
            {
                return;
            }

            // convert geometry
            if (curve.GetType() != typeof(LineCurve))
            {
                throw new System.ArgumentException("Curve must be a LineCurve");
            }
            FemDesign.Geometry.Edge edge = Convert.FromRhinoLineCurve((LineCurve)curve);

            // bar
            var type = FemDesign.Bars.BarType.Truss;

            FemDesign.Bars.Bar bar = new FemDesign.Bars.Bar(edge, type, material, section, identifier);
            bar.MaxCompression        = maxCompression;
            bar.MaxTension            = maxTension;
            bar.CompressionPlasticity = compressionPlasticity;
            bar.TensionPlasticity     = tensionPlasticity;

            // set local y-axis
            if (!v.Equals(Vector3d.Zero))
            {
                bar.BarPart.LocalY = v.FromRhino();
            }

            // else orient coordinate system to GCS
            else
            {
                if (orientLCS)
                {
                    bar.BarPart.OrientCoordinateSystemToGCS();
                }
            }

            // return
            DA.SetData(0, bar);
        }
コード例 #10
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input
            Curve curve = null;

            if (!DA.GetData(0, ref curve))
            {
                return;
            }

            FemDesign.Materials.Material material = null;
            if (!DA.GetData(1, ref material))
            {
                return;
            }

            FemDesign.Sections.Section section = null;
            if (!DA.GetData(2, ref section))
            {
                return;
            }

            FemDesign.Bars.Connectivity connectivity = FemDesign.Bars.Connectivity.GetRigid();
            if (!DA.GetData(3, ref connectivity))
            {
                // pass
            }

            FemDesign.Bars.Eccentricity eccentricity = FemDesign.Bars.Eccentricity.GetDefault();
            if (!DA.GetData(4, ref eccentricity))
            {
                // pass
            }

            Vector3d v = Vector3d.Zero;

            if (!DA.GetData(5, ref v))
            {
                // pass
            }

            bool orientLCS = true;

            if (!DA.GetData(6, ref orientLCS))
            {
                // pass
            }

            string identifier = "B";

            if (!DA.GetData(7, ref identifier))
            {
                // pass
            }

            if (curve == null || material == null || section == null || connectivity == null || eccentricity == null || identifier == null)
            {
                return;
            }

            // convert geometry
            FemDesign.Geometry.Edge edge = curve.FromRhinoLineOrArc2();

            // create bar
            var type = FemDesign.Bars.BarType.Beam;

            FemDesign.Bars.Bar bar = new FemDesign.Bars.Bar(edge, type, material, section, eccentricity, connectivity, identifier);

            // set local y-axis
            if (!v.Equals(Vector3d.Zero))
            {
                bar.BarPart.LocalY = v.FromRhino();
            }

            // else orient coordinate system to GCS
            else
            {
                if (orientLCS)
                {
                    bar.BarPart.OrientCoordinateSystemToGCS();
                }
            }

            // output
            DA.SetData(0, bar);
        }
コード例 #11
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input
            Brep surface = null;

            if (!DA.GetData(0, ref surface))
            {
                return;
            }

            FemDesign.Materials.Material material = null;
            if (!DA.GetData(1, ref material))
            {
                return;
            }

            FemDesign.Sections.Section section = null;
            if (!DA.GetData(2, ref section))
            {
                return;
            }

            FemDesign.Shells.ShellEccentricity eccentricity = FemDesign.Shells.ShellEccentricity.GetDefault();
            if (!DA.GetData(3, ref eccentricity))
            {
                // pass
            }

            double orthoRatio = 1;

            if (!DA.GetData(4, ref orthoRatio))
            {
                // pass
            }

            FemDesign.Shells.EdgeConnection edgeConnection = FemDesign.Shells.EdgeConnection.GetHinged();
            if (!DA.GetData(5, ref edgeConnection))
            {
                // pass
            }

            Rhino.Geometry.Vector3d x = Vector3d.Zero;
            if (!DA.GetData(6, ref x))
            {
                // pass
            }

            Rhino.Geometry.Vector3d z = Vector3d.Zero;
            if (!DA.GetData(7, ref z))
            {
                // pass
            }

            double meshSize = 0;

            if (!DA.GetData(8, ref meshSize))
            {
                // pass
            }

            string identifier = "PP";

            if (!DA.GetData(9, ref identifier))
            {
                // pass
            }

            if (surface == null || material == null || section == null || eccentricity == null || edgeConnection == null || identifier == null)
            {
                return;
            }


            FemDesign.Geometry.Region region = surface.FromRhino();

            //
            FemDesign.Shells.Panel obj = FemDesign.Shells.Panel.DefaultContreteContinuous(region, edgeConnection, material, section, identifier, orthoRatio, eccentricity);

            // set local x-axis
            if (!x.Equals(Vector3d.Zero))
            {
                obj.LocalX = x.FromRhino();
            }

            // set local z-axis
            if (!z.Equals(Vector3d.Zero))
            {
                obj.LocalZ = z.FromRhino();
            }

            // set uniform average mesh size
            obj.UniformAvgMeshSize = meshSize;

            // return
            DA.SetData(0, obj);
        }