-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c1cebd
commit ea20fb0
Showing
8 changed files
with
303 additions
and
83 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
FemDesign.Grasshopper/Sections/Composite/DeltaBeamProfile.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
using System; | ||
using Grasshopper.Kernel; | ||
using Grasshopper.Kernel.Parameters; | ||
using Grasshopper.Kernel.Types; | ||
using FemDesign.Grasshopper.Components.UIWidgets; | ||
|
||
|
||
namespace FemDesign.Grasshopper | ||
{ | ||
public class DeltaBeamProfile : SubComponent | ||
{ | ||
public override string name() => "DeltaBeamProfile"; | ||
public override string display_name() => "DeltaBeamProfile"; | ||
|
||
public override void registerEvaluationUnits(EvaluationUnitManager mngr) | ||
{ | ||
EvaluationUnit evaluationUnit = new EvaluationUnit(name(), display_name(), "Create a composite section for Deltabeam sections. For more information, see FEM-Design GUI."); | ||
mngr.RegisterUnit(evaluationUnit); | ||
|
||
evaluationUnit.RegisterInputParam(new Param_String(), "SectionName", "SectionName", "Composite section name.", GH_ParamAccess.item); | ||
evaluationUnit.Inputs[evaluationUnit.Inputs.Count - 1].Parameter.Optional = true; | ||
|
||
evaluationUnit.RegisterInputParam(new Param_GenericObject(), "Steel", "Steel", "Steel material.", GH_ParamAccess.item); | ||
evaluationUnit.Inputs[evaluationUnit.Inputs.Count - 1].Parameter.Optional = true; | ||
|
||
evaluationUnit.RegisterInputParam(new Param_GenericObject(), "Concrete", "Concrete", "Concrete material.", GH_ParamAccess.item); | ||
evaluationUnit.Inputs[evaluationUnit.Inputs.Count - 1].Parameter.Optional = true; | ||
|
||
evaluationUnit.RegisterInputParam(new Param_GenericObject(), "DeltaBeamProfile", "DeltaBeamProfile", "Steel DeltaBeam profile. Can be 'D' or 'DR' section family types.", GH_ParamAccess.item); | ||
evaluationUnit.Inputs[evaluationUnit.Inputs.Count - 1].Parameter.Optional = true; | ||
} | ||
|
||
public override void SolveInstance(IGH_DataAccess DA, out string msg, out GH_RuntimeMessageLevel level) | ||
{ | ||
msg = ""; | ||
level = GH_RuntimeMessageLevel.Warning; | ||
|
||
// get input | ||
string name = null; | ||
if (!DA.GetData(0, ref name)) { return; } | ||
|
||
Materials.Material steel = new Materials.Material(); | ||
if (!DA.GetData(1, ref steel)) { return; } | ||
|
||
Materials.Material concrete = new Materials.Material(); | ||
if (!DA.GetData(2, ref concrete)) { return; } | ||
|
||
Sections.Section deltaProf = null; | ||
if (!DA.GetData(3, ref deltaProf)) { return; } | ||
|
||
// check input data | ||
if (steel.Family != Materials.Family.Steel) | ||
{ | ||
throw new ArgumentException($"Steel input must be steel material but it is {steel.Family}"); | ||
} | ||
if (concrete.Family != Materials.Family.Concrete) | ||
{ | ||
throw new ArgumentException($"Concrete input must be concrete material but it is {concrete.Family}"); | ||
} | ||
|
||
// create composite section | ||
Composites.CompositeSection compositeSection = Composites.CompositeSection.FilledDeltaBeamProfile(name, steel, concrete, deltaProf); | ||
|
||
// get output | ||
DA.SetData(0, compositeSection); | ||
} | ||
|
||
protected void setModelProps() | ||
{ | ||
this.Parent_Component.ExpireSolution(true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters