public static Section Define(List <Autodesk.DesignScript.Geometry.Surface> surfaces, string name, string materialType, string groupName, string typeName, string sizeName) { // check if string input is null if (name == null || materialType == null || groupName == null || typeName == null || sizeName == null) { throw new System.ArgumentException($"Some input is null. name: {name}, materialType: {materialType}, groupName: {groupName}, typeName: {typeName}, sizeName: {sizeName}"); } // convert geometry List <Geometry.Region> regions = new List <Geometry.Region>(); foreach (Autodesk.DesignScript.Geometry.Surface surface in surfaces) { regions.Add(Geometry.Region.FromDynamo(surface)); } // create regions group Geometry.RegionGroup regionGroup = new Geometry.RegionGroup(regions); // get mat type FemDesign.Materials.MaterialTypeEnum matTypeEnum = (FemDesign.Materials.MaterialTypeEnum)Enum.Parse(typeof(FemDesign.Materials.MaterialTypeEnum), materialType); // create section Sections.Section section = new Sections.Section(regionGroup, name, "custom", matTypeEnum, groupName, typeName, sizeName); // return return(section); }
/// <summary> /// Constructor to create a ModelSection. /// </summary> /// <param name="pos">Position parameter (0-1).</param> /// <param name="section">Cross-section at pos.</param> /// <param name="eccentricity">Eccentricity at pos.</param> internal ComplexSectionPart(double pos, Section section, Bars.Eccentricity eccentricity) { this.Pos = pos; this.SectionRef = section.Guid; this.SectionObj = section; this.Eccentricity = eccentricity; this.End = ""; }
/// <summary> /// Construct beam or column with start/end section and different start/end conditions /// </summary> /// <param name="edge"></param> /// <param name="type"></param> /// <param name="material"></param> /// <param name="startSection">Start section</param> /// <param name="endSection">End section</param> /// <param name="startEccentricity">Analytical start eccentricity</param> /// <param name="endEccentricity">Analytical end eccentricity</param> /// <param name="startConnectivity">Start connectivity</param> /// <param name="endConnectivity">End connectivity</param> /// <param name="identifier">Identifier</param> public Bar(Geometry.Edge edge, BarType type, Materials.Material material, Sections.Section startSection, Sections.Section endSection, Eccentricity startEccentricity, Eccentricity endEccentricity, Connectivity startConnectivity, Connectivity endConnectivity, string identifier) { if (type == BarType.Truss) { throw new System.Exception("Truss is not a valid type"); } this.EntityCreated(); this.Type = type; this.Identifier = identifier; this.BarPart = new BarPart(edge, this.Type, material, startSection, endSection, startEccentricity, endEccentricity, startConnectivity, endConnectivity, this.Identifier); }
/// <summary> /// Construct a truss element. BarType must be specified as Truss. /// </summary> /// <param name="edge"></param> /// <param name="type"></param> /// <param name="material"></param> /// <param name="section"></param> /// <param name="identifier"></param> /// <exception cref="System.Exception"></exception> public Bar(Geometry.Edge edge, BarType type, Materials.Material material, Sections.Section section, string identifier) { if (type != BarType.Truss) { throw new System.Exception("Truss is not a valid type"); } this.EntityCreated(); this.Type = type; this.Identifier = identifier; this.BarPart = new BarPart(edge, this.Type, material, section, this.Identifier); }
/// <summary> /// Construct beam or column with uniform section and uniform start/end conditions /// </summary> /// <param name="edge"></param> /// <param name="type"></param> /// <param name="material"></param> /// <param name="section">Section, same at start/end</param> /// <param name="eccentricity">Analytical eccentricity, same at start. Eccentricity set to 0,0 if null/end</param> /// <param name="connectivity">Connectivity, same at start/end. Connectivity set to Rigid if null</param> /// <param name="identifier">Identifier</param> public Bar(Geometry.Edge edge, BarType type, Materials.Material material, Sections.Section section, Eccentricity eccentricity = null, Connectivity connectivity = null, string identifier = "B") { if (type == BarType.Truss) { throw new System.Exception("Truss is not a valid type"); } this.EntityCreated(); this.Type = type; this.Identifier = identifier; if (eccentricity == null) { eccentricity = Eccentricity.GetDefault(); } if (connectivity == null) { connectivity = Connectivity.GetDefault(); } this.BarPart = new BarPart(edge, this.Type, material, section, eccentricity, connectivity, this.Identifier); }
protected override void SolveInstance(IGH_DataAccess DA) { Sections.SectionDatabase db = null; if (!DA.GetData(0, ref db)) { return; } Sections.Section section = null; if (!DA.GetData(1, ref section)) { return; } // clone section db Sections.SectionDatabase obj = db.DeepClone(); // add section obj.AddNewSection(section); // return DA.SetData(0, obj); }
public static Panel ProfiledPlate(Autodesk.DesignScript.Geometry.Surface surface, Materials.Material material, Sections.Section section, [DefaultArgument("ShellEccentricity.Default()")] ShellEccentricity eccentricity, [DefaultArgument("1")] double orthoRatio, [DefaultArgument("EdgeConnection.Hinged()")] EdgeConnection edgeConnection, [DefaultArgument("Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0,0,0)")] Autodesk.DesignScript.Geometry.Vector localX, [DefaultArgument("Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0,0,0)")] Autodesk.DesignScript.Geometry.Vector localZ, [DefaultArgument("0")] double avgMeshSize, string identifier = "PP") { // convert geometry Geometry.Region region = Geometry.Region.FromDynamo(surface); // create panel Panel obj = Panel.DefaultContreteContinuous(region, edgeConnection, material, section, identifier, orthoRatio, eccentricity); // set local x-axis if (!localX.Equals(Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 0))) { obj.LocalX = FemDesign.Geometry.FdVector3d.FromDynamo(localX); } // set local z-axis if (!localZ.Equals(Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 0))) { obj.LocalZ = FemDesign.Geometry.FdVector3d.FromDynamo(localZ); } // set mesh obj.UniformAvgMeshSize = avgMeshSize; // return return(obj); }
public static Bar TrussLimitedCapacity(Autodesk.DesignScript.Geometry.Line line, Materials.Material material, Sections.Section section, double maxCompression, double maxTension, bool compressionPlasticity, bool tensionPlasticity, [DefaultArgument("Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0,0,0)")] Autodesk.DesignScript.Geometry.Vector localY, [DefaultArgument("true")] bool orientLCS, string identifier = "T") { // convert class Geometry.Edge edge = Geometry.Edge.FromDynamoLine(line); // create bar var type = BarType.Truss; Bar bar = new Bar(edge, type, material, section, identifier); bar.MaxCompression = maxCompression; bar.MaxTension = maxTension; bar.CompressionPlasticity = compressionPlasticity; bar.TensionPlasticity = tensionPlasticity; // set local y-axis if (!localY.Equals(Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 0))) { bar.BarPart.LocalY = FemDesign.Geometry.FdVector3d.FromDynamo(localY); } // else orient coordinate system to GCS else { if (orientLCS) { bar.BarPart.OrientCoordinateSystemToGCS(); } } // return return(bar); }
/// <summary> /// Create a default concrete shell with panels using a continuous analytical model. /// </summary> /// <param name="region">Panel region.</param> /// <param name="externalEdgeConnection"></param> /// <param name="material"></param> /// <param name="section"></param> /// <param name="identifier">Name of shell.</param> /// <param name="orthotropy"></param> /// <param name="ecc"></param> /// <returns></returns> public static Panel DefaultContreteContinuous(Geometry.Region region, EdgeConnection externalEdgeConnection, Materials.Material material, Sections.Section section, string identifier, double orthotropy, ShellEccentricity ecc) { Geometry.FdPoint3d anchorPoint = region.Contours[0].Edges[0].Points[0]; InternalPanel internalPanel = new InternalPanel(region); InternalPanels internalPanels = new InternalPanels(internalPanel); PanelType type = PanelType.Concrete; string panelName = "A"; double gap = 0.003; bool externalMovingLocal = externalEdgeConnection.MovingLocal; return(new Panel(region, anchorPoint, internalPanels, externalEdgeConnection, type, material, section, identifier, panelName, gap, orthotropy, ecc, externalMovingLocal)); }
/// <summary> /// Construct standard panel with "Continuous" analytical model. /// </summary> /// <param name="region">Region of shell containing panels.</param> /// <param name="localX">Direction of panels.</param> /// <param name="anchorPoint"></param> /// <param name="externalRigidity">Default value for shell border EdgeConnections. Can be overwritten by EdgeConnection for each specific edge in Region.</param> /// <param name="type">Type of panel.</param> /// <param name="complexMaterial">Guid reference to material.</param> /// <param name="complexSection">Guid reference to complex section.</param> /// <param name="identifier">Name of shell.</param> /// <param name="panelName">Name of panel.</param> /// <param name="gap">Gap between panels.</param> /// <param name="orthotropy">Orthotropy.</param> /// <param name="ecc">ShellEccentricity.</param> /// <param name="externalMovingLocal">EdgeConnection LCS changes along edge?</param> internal Panel(Geometry.Region region, Geometry.FdPoint3d anchorPoint, InternalPanels internalPanels, EdgeConnection externalEdgeConnection, PanelType type, Materials.Material material, Sections.Section section, string identifier, string panelName, double gap, double orthotropy, ShellEccentricity ecc, bool externalMovingLocal) { this.EntityCreated(); // elements this.Region = region; this.CoordinateSystem = region.CoordinateSystem; this.AnchorPoint = anchorPoint; this.InternalPanels = internalPanels; this.ExternalRigidity = externalEdgeConnection.Rigidity; // set edge connections this.SetExternalEdgeConnections(externalEdgeConnection); // attributes this.Type = type; this.Material = material; // note that material and section are not added directly to complexMaterial and complexSection fields. this.Section = section; this.Identifier = identifier; this.PanelName = panelName; this.Gap = gap; this.Orthotropy = orthotropy; this.Alignment = ecc.Alignment; this.AlignOffset = ecc.Eccentricity; this.EccentricityCalculation = ecc.EccentricityCalculation; this.EccentricityByCracking = ecc.EccentricityByCracking; this.ExternalMovingLocal = externalMovingLocal; }