Skip to content

Commit

Permalink
Merge branch '1132-line-connection-predefined-rigidity-deconstruct' i…
Browse files Browse the repository at this point in the history
…nto 23.9.0_Dev
  • Loading branch information
Marco-Pellegrino committed Dec 9, 2024
2 parents 7c7fdd8 + d0455ac commit efee564
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,24 @@ protected override void SolveInstance(IGH_DataAccess DA)
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);



if(obj.Rigidity != null)
{
DA.SetData(3, obj.Rigidity.Motions);
DA.SetData(4, obj.Rigidity.PlasticLimitForces);
DA.SetData(5, obj.Rigidity.Rotations);
DA.SetData(6, obj.Rigidity.PlasticLimitMoments);
}
else
{
DA.SetData(3, obj.PredefRigidity.Rigidity.Motions);
DA.SetData(4, obj.PredefRigidity.Rigidity.PlasticLimitForces);
DA.SetData(5, obj.PredefRigidity.Rigidity.Rotations);
DA.SetData(6, obj.PredefRigidity.Rigidity.PlasticLimitMoments);
}

DA.SetData(7, obj.LocalX.ToRhino());
DA.SetData(8, obj.LocalY.ToRhino());
DA.SetData(9, obj.Name);
Expand All @@ -60,7 +74,7 @@ protected override System.Drawing.Bitmap Icon
}
public override Guid ComponentGuid
{
get { return new Guid("{0327EABF-6045-439C-AB65-B1E34DB190C6}"); }
get { return new Guid("{47290B88-5004-4565-861F-D9AEB2C3CFF6}"); }
}

public override GH_Exposure Exposure => GH_Exposure.senary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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("{B8AC9665-4A7B-43DF-9D57-D08C01430807}"); }
}

public override GH_Exposure Exposure => GH_Exposure.hidden;
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_OBSOLETE2 : FEM_Design_API_Component
{
public LineConnectionDeconstruct_OBSOLETE2() : 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;

}
}
5 changes: 3 additions & 2 deletions FemDesign.Grasshopper/FemDesign.Grasshopper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,11 @@
<Compile Include="Components\UIWidgets\WidgetServer.cs" />
<Compile Include="Deconstruct\Drawing\TextAnnotationDeconstruct.cs" />
<Compile Include="Deconstruct\Drawing\DimensionLinearDeconstruct.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\FictitiousBarDeconstruct_OBSOLETE2306.cs" />
<Compile Include="Deconstruct\ModellingTools\OBSOLETE\LineConnectionDeconstruct_OBSOLETE.cs" />
<Compile Include="Deconstruct\ModellingTools\PointConnectionDeconstruct.cs" />
<Compile Include="Deconstruct\ModellingTools\OBSOLETE\LineConnectionDeconstruct_OBSOLETE2.cs" />
<Compile Include="Deconstruct\ModellingTools\SurfaceConnectionDeconstruct.cs" />
<Compile Include="Deconstruct\SectionDeconstruct _OBSOLETE2307.cs" />
<Compile Include="Deconstruct\StructureGrid\AxisDeconstruct.cs" />
Expand Down

0 comments on commit efee564

Please sign in to comment.