Skip to content

Commit

Permalink
member eccentricities and cross sextions
Browse files Browse the repository at this point in the history
member eccentricities added
new geometric properties in cross section component
member eccentricities considered in visualization of extruded members
  • Loading branch information
diego-apellaniz committed Sep 29, 2021
1 parent dbe5983 commit 62203af
Show file tree
Hide file tree
Showing 77 changed files with 4,571 additions and 555 deletions.
Binary file modified Examples/01 - Get Data/01 Parametric FEM Toolbox - Get Data.gh
Binary file not shown.
Binary file modified Examples/01 - Get Data/01 Parametric FEM Toolbox - Get Data.rf5
Binary file not shown.
Binary file modified Examples/02 - Set Data/02 Parametric FEM Toolbox - Set Data.gh
Binary file not shown.
Binary file modified Examples/02 - Set Data/02 Parametric FEM Toolbox - Set Data.rf5
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Examples/04 - Scripting/04 Parametric FEM Toolbox - Scripting.gh
Binary file not shown.
Binary file not shown.
Binary file modified Examples/05 - Loads/05 Parametric FEM Toolbox - Loads.gh
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Examples/10 - LCA/10 Parametric FEM Toolbox - LCA.gh
Binary file not shown.
Binary file modified Examples/10 - LCA/10 Parametric FEM Toolbox - LCA.rf5
Binary file not shown.
Binary file modified Parametric_FEM_Toolbox/.vs/Parametric_FEM_Toolbox/v16/.suo
Binary file not shown.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using Grasshopper.Kernel.Parameters;
using Grasshopper.Kernel.Types;

namespace Parametric_FEM_Toolbox.GUI
namespace Parametric_FEM_Toolbox.Deprecated
{
public class Component_RFCroSec_GUI_OBSOLETE: GH_SwitcherComponent
{
Expand Down Expand Up @@ -82,8 +82,8 @@ protected override void OnComponentLoaded()
// The PostConstructor is called from within each constructor.DO NOT OVERRIDE THIS unless you know what you are doing.
protected override void RegisterEvaluationUnits(EvaluationUnitManager mngr)
{
subcomponents_.Add(new SubComponent_RFCroSec_Assemble_GUI());
subcomponents_.Add(new SubComponent_RFCroSec_Disassemble_GUI());
subcomponents_.Add(new SubComponent_RFCroSec_Assemble_GUI_OBSOLETE());
subcomponents_.Add(new SubComponent_RFCroSec_Disassemble_GUI_OBSOLETE_2());

foreach (SubComponent item in subcomponents_)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Parametric_FEM_Toolbox.Deprecated
{
public class Component_RFCroSec_GUI_OBSOLETE : GH_SwitcherComponent
public class Component_RFCroSec_GUI_OBSOLETE_2 : GH_SwitcherComponent
{
// Declare class variables outside the method "SolveInstance" so their values persist
// when the method is called again.
Expand All @@ -28,7 +28,7 @@ public class Component_RFCroSec_GUI_OBSOLETE : GH_SwitcherComponent
/// Subcategory the panel. If you use non-existing tab or panel names,
/// new tabs/panels will automatically be created.
/// </summary>
public Component_RFCroSec_GUI_OBSOLETE()
public Component_RFCroSec_GUI_OBSOLETE_2()
: base("RF Cross Section", "RFCroSec", "Creates a RFCroSec object to define new data or modify existing data " +
"in the RFEM model.", "B+G Toolbox", "RFEM")
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
using System;
using System.Collections.Generic;
using System.Linq;

using Grasshopper.Kernel;
using Rhino.Geometry;

using Parametric_FEM_Toolbox.RFEM;
using Parametric_FEM_Toolbox.Utilities;
using Dlubal.RFEM5;
using System.Runtime.InteropServices;
using Parametric_FEM_Toolbox.UIWidgets;
using Grasshopper.Kernel.Parameters;
using Grasshopper.Kernel.Types;

namespace Parametric_FEM_Toolbox.Deprecated
{
public class Component_RFCroSec_GUI_OBSOLETE_3 : GH_SwitcherComponent
{
// Declare class variables outside the method "SolveInstance" so their values persist
// when the method is called again.
private List<SubComponent> subcomponents_ = new List<SubComponent>();
public override string UnitMenuName => "Type of Component";
protected override string DefaultEvaluationUnit => subcomponents_[0].name();


/// <summary>
/// Each implementation of GH_Component must provide a public
/// constructor without any arguments.
/// Category represents the Tab in which the component will appear,
/// Subcategory the panel. If you use non-existing tab or panel names,
/// new tabs/panels will automatically be created.
/// </summary>
public Component_RFCroSec_GUI_OBSOLETE_3()
: base("RF Cross Section", "RFCroSec", "Assembles and Disassembles RFCroSec objects.", "B+G Toolbox", "RFEM")
{
this.Hidden = (true);
}

// Define Keywords to search for this Component more easily in Grasshopper
public override IEnumerable<string> Keywords => new string[] {"rf", "rfcrosssection",};


/// <summary>
/// Registers all the input parameters for this component.
/// </summary>
protected override void RegisterInputParams(GH_InputParamManager pManager)
{
// Use the pManager object to register your input parameters.
//pManager.AddBooleanParameter("Nodes in RFEM Model", "Nodes", "Nodes to get from the RFEM Model.", GH_ParamAccess.item, false);

// If you want to change properties of certain parameters,
// you can use the pManager instance to access them by index:
// pManager[0].Optional = true;


}

/// <summary>
/// Registers all the output parameters for this component.
/// </summary>
protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
{
// Use the pManager object to register your output parameters.
// Output parameters do not have default values, but they too must have the correct access type.


// Sometimes you want to hide a specific parameter from the Rhino preview.
// You can use the HideParameter() method as a quick way:
// pManager.HideParameter(0);
}

protected override void OnComponentLoaded()
{
base.OnComponentLoaded();
foreach (SubComponent item in subcomponents_)
{
item.OnComponentLoaded();
}
}

// The PostConstructor is called from within each constructor.DO NOT OVERRIDE THIS unless you know what you are doing.
protected override void RegisterEvaluationUnits(EvaluationUnitManager mngr)
{
subcomponents_.Add(new SubComponent_RFCroSec_Assemble_GUI_OBSOLETE());
subcomponents_.Add(new SubComponent_RFCroSec_Disassemble_GUI_OBSOLETE_2());

foreach (SubComponent item in subcomponents_)
{
item.registerEvaluationUnits(mngr);
}
}

/// <summary>
/// This is the method that actually does the work.
/// </summary>
/// <param name="DA">The DA object can be used to retrieve data from input parameters and
/// to store data in output parameters.</param>
protected override void SolveInstance(IGH_DataAccess DA, EvaluationUnit unit)
{
if (unit != null)
{
foreach (SubComponent item in subcomponents_)
{
if (unit.Name.Equals(item.name()))
{
item.SolveInstance(DA, out string msg, out GH_RuntimeMessageLevel level);
if (msg != "")
{
this.AddRuntimeMessage(level, msg + "It may cause errors.");
}
return;
}
}
throw new Exception("Invalid sub-component");
}
}

/// <summary>
/// The Exposure property controls where in the panel a component icon
/// will appear. There are seven possible locations (primary to septenary),
/// each of which can be combined with the GH_Exposure.obscure flag, which
/// ensures the component will only be visible on panel dropdowns.
/// </summary>
public override GH_Exposure Exposure
{
get { return GH_Exposure.hidden; }
}

/// <summary>
/// Provides an Icon for every component that will be visible in the User Interface.
/// Icons need to be 24x24 pixels.
/// </summary>
protected override System.Drawing.Bitmap Icon
{
get
{
// You can add image files to your project resources and access them like this:
//return Resources.IconForThisComponent;
return Properties.Resources.Assemble_CroSec;
}
}

/// <summary>
/// Each component must have a unique Guid to identify it.
/// It is vital this Guid doesn't change otherwise old ghx files
/// that use the old ID will partially fail during loading.
/// </summary>
public override Guid ComponentGuid
{
get { return new Guid("c5e6486e-a735-4c6c-964e-c9074239892c"); }
}
}
}
Loading

0 comments on commit 62203af

Please sign in to comment.