Skip to content

Commit

Permalink
🐛 identifier output
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco-Pellegrino committed Aug 30, 2024
1 parent 75ce8d9 commit acb4136
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://strusoft.com/
// https://strusoft.com/
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -49,7 +49,7 @@ protected override void SolveInstance(IGH_DataAccess DA)
DA.SetData(6, obj.Rigidity.PlasticLimitMoments);
DA.SetData(7, obj.LocalX.ToRhino());
DA.SetData(8, obj.LocalY.ToRhino());
DA.SetData(9, obj.Identifier);
DA.SetData(9, obj.Name);
}
protected override System.Drawing.Bitmap Icon
{
Expand All @@ -60,7 +60,7 @@ protected override System.Drawing.Bitmap Icon
}
public override Guid ComponentGuid
{
get { return new Guid("{B4480216-0C2E-4B63-AA52-3764992D3886}"); }
get { return new Guid("{0327EABF-6045-439C-AB65-B1E34DB190C6}"); }
}

public override GH_Exposure Exposure => GH_Exposure.senary;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// https://strusoft.com/
using System;
using System.Collections.Generic;
using System.Linq;
using Grasshopper.Kernel;
using Rhino.Geometry;

namespace FemDesign.Grasshopper
{
public class LineConnectionDeconstruct_OBSOLETE : FEM_Design_API_Component
{
public LineConnectionDeconstruct_OBSOLETE() : base("LineConnection.Deconstruct", "Deconstruct", "Deconstruct a LineConnection.", CategoryName.Name(), "Deconstruct")
{

}
protected override void RegisterInputParams(GH_InputParamManager pManager)
{
pManager.AddGenericParameter("LineConnection", "LnConnect", "LineConnection from ModellingTools.", GH_ParamAccess.item);
}
protected override void RegisterOutputParams(GH_OutputParamManager pManager)
{
pManager.AddTextParameter("Guid", "Guid", "Guid.", GH_ParamAccess.item);
pManager.AddGenericParameter("ConnectedElementsReference", "Ref", "GUIDs of connected structural elements (e.g. slabs, surface supports, fictious shells, etc).", GH_ParamAccess.list);
pManager.AddLineParameter("Lines", "Lns", "Master line and slave line.", GH_ParamAccess.list);
pManager.AddGenericParameter("Motion", "Mot", "Motion release.", GH_ParamAccess.item);
pManager.AddGenericParameter("MotionsPlasticLimits", "PlaLimM", "Plastic limits forces for motion springs.", GH_ParamAccess.item);
pManager.AddGenericParameter("Rotation", "Rot", "Rotation release.", GH_ParamAccess.item);
pManager.AddGenericParameter("RotationsPlasticLimits", "PlaLimR", "Plastic limits moments for rotation springs.", GH_ParamAccess.item);
pManager.AddVectorParameter("LocalX", "X", "Local x-axis.", GH_ParamAccess.item);
pManager.AddVectorParameter("LocalY", "Y", "Local y-axis.", GH_ParamAccess.item);
pManager.AddTextParameter("Identifier", "ID", "Identifier.", GH_ParamAccess.item);
}
protected override void SolveInstance(IGH_DataAccess DA)
{
// get input
FemDesign.ModellingTools.ConnectedLines obj = null;
if (!DA.GetData(0, ref obj)) { return; }
if (obj == null) { return; }

var rhinoLines = obj.Edges.Select(l => l.ToRhino()).ToList();

// get output
DA.SetData(0, obj.Guid);
DA.SetDataList(1, obj.References);
DA.SetDataList(2, rhinoLines);
DA.SetData(3, obj.Rigidity.Motions);
DA.SetData(4, obj.Rigidity.PlasticLimitForces);
DA.SetData(5, obj.Rigidity.Rotations);
DA.SetData(6, obj.Rigidity.PlasticLimitMoments);
DA.SetData(7, obj.LocalX.ToRhino());
DA.SetData(8, obj.LocalY.ToRhino());
DA.SetData(9, obj.Identifier);
}
protected override System.Drawing.Bitmap Icon
{
get
{
return FemDesign.Properties.Resources.LineConnectionDeconstruct;
}
}
public override Guid ComponentGuid
{
get { return new Guid("{B4480216-0C2E-4B63-AA52-3764992D3886}"); }
}

public override GH_Exposure Exposure => GH_Exposure.hidden;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected override void SolveInstance(IGH_DataAccess DA)
DA.SetData(6, obj.Rigidity.PlasticLimitMoments);
DA.SetData(7, obj.LocalX.ToRhino());
DA.SetData(8, obj.LocalY.ToRhino());
DA.SetData(9, obj.Identifier);
DA.SetData(9, obj.Name);
}
protected override System.Drawing.Bitmap Icon
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected override void SolveInstance(IGH_DataAccess DA)
DA.SetData(5, obj.LocalX.ToRhino());
DA.SetData(6, obj.LocalZ.ToRhino());
DA.SetData(7, obj.Distance);
DA.SetData(8, obj.Identifier);
DA.SetData(8, obj.Name);
}
protected override System.Drawing.Bitmap Icon
{
Expand Down
5 changes: 3 additions & 2 deletions FemDesign.Grasshopper/FemDesign.Grasshopper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@
<Compile Include="Components\UIWidgets\WidgetServer.cs" />
<Compile Include="Deconstruct\Drawing\TextAnnotationDeconstruct.cs" />
<Compile Include="Deconstruct\Drawing\DimensionLinearDeconstruct.cs" />
<Compile Include="Deconstruct\ModellingTools\FictitiousBarDeconstruct_OBSOLETE2306.cs" />
<Compile Include="Deconstruct\ModellingTools\PointConnectionDeconstruct.cs" />
<Compile Include="Deconstruct\ModellingTools\OBSOLETE\FictitiousBarDeconstruct_OBSOLETE2306.cs" />
<Compile Include="Deconstruct\ModellingTools\LineConnectionDeconstruct.cs" />
<Compile Include="Deconstruct\ModellingTools\PointConnectionDeconstruct.cs" />
<Compile Include="Deconstruct\ModellingTools\OBSOLETE\LineConnectionDeconstruct_OBSOLETE.cs" />
<Compile Include="Deconstruct\ModellingTools\SurfaceConnectionDeconstruct.cs" />
<Compile Include="Deconstruct\StructureGrid\AxisDeconstruct.cs" />
<Compile Include="Loads\Load groups\LoadGroupToLoadComb.cs" />
Expand Down

0 comments on commit acb4136

Please sign in to comment.