Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2471a50
Update assembly file version to 9.0.0.0 and AssemblyVersion to 9.0.0.0
BHoMBot Sep 30, 2025
5c41545
Start of milestone changes for 9.0 (#121)
adecler Oct 2, 2025
7a3d46e
Removing Previous Version attribute for 8.3
adecler Oct 2, 2025
25f7803
Removing Previous Version attribute for 8.3 (#122)
michaelhoehn Oct 3, 2025
694fcf3
Update node access in Bar geometry reader
Arne-Martensen Oct 16, 2025
5a395fd
Pulling Bars in Reversed Orientation (#124)
peterjamesnugent Oct 16, 2025
02bf146
Refactor BarResults test and adapter logic
Arne-Martensen Oct 20, 2025
e36fc16
Error Handling For Bar Result Reading (#126)
peterjamesnugent Oct 24, 2025
b921cad
Add support for RFEM6 free polygon loads
Arne-Martensen Oct 27, 2025
5be0779
Support polygon geometry for area loads in RFEM6 adapter
Arne-Martensen Oct 28, 2025
7901857
Add support for polygon area loads in RFEM6 adapter
Arne-Martensen Oct 28, 2025
673f5d2
Set load projection dynamically based on polygon plane
Arne-Martensen Oct 28, 2025
94fc3b7
Add error handling to CreateLoad_Polygon method
Arne-Martensen Oct 28, 2025
dc91c78
Add warnings for unsupported 'Projected' option with Local axis
Arne-Martensen Nov 3, 2025
14343b2
Warn if load direction is not axis-aligned
Arne-Martensen Nov 3, 2025
6256d15
Update RFEM6_Adapter/Convert/ToRFEM6/BHoMDataStructure/Loading/Load.cs
Arne-Martensen Nov 5, 2025
56d3f53
Update RFEM6_Adapter/Convert/ToRFEM6/BHoMDataStructure/Loading/Load.cs
Arne-Martensen Nov 5, 2025
6557de1
Update RFEM6_Adapter/Convert/ToRFEM6/BHoMDataStructure/Loading/Load.cs
Arne-Martensen Nov 5, 2025
13118ef
Update RFEM6_Adapter/Convert/ToRFEM6/BHoMDataStructure/Loading/Load.cs
Arne-Martensen Nov 5, 2025
9d09184
Update RFEM6_Adapter/CRUD/Read/BHoMDataStructure/Loading/Load.cs
Arne-Martensen Nov 5, 2025
fba38de
Update RFEM6_Adapter/CRUD/Read/BHoMDataStructure/Loading/Load.cs
Arne-Martensen Nov 5, 2025
7f69ab5
Update RFEM6_Adapter/Convert/FromRFEM6/BHoMDataStructure/Loading/Load.cs
Arne-Martensen Nov 5, 2025
51100f6
Fix variable name typo and add loadProjection assignment
Arne-Martensen Nov 5, 2025
8c5befa
Fix typos and variable naming in Load.cs files
Arne-Martensen Nov 5, 2025
2dec64a
Remove unused ReadPolygonLoad method
Arne-Martensen Nov 5, 2025
b5d3cbe
Update RFEM6_Adapter/CRUD/Create/BHoMDataStructure/Loading/Load.cs
Arne-Martensen Nov 5, 2025
621a5bd
Update Load.cs
Arne-Martensen Nov 5, 2025
b6971d0
Merge branch 'RFEM6_Toolkit-#127-AddFreePolygonalLoads' of https://gi…
Arne-Martensen Nov 5, 2025
0d37827
Update Load.cs
Arne-Martensen Nov 5, 2025
949f6f7
Push of Free Polygonal Loads (#129)
peterjamesnugent Nov 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ public void InitializeOpenings()
public void PushPullPanel()
{

adapter.Push(new List<Panel>() { panel1});
//adapter.Push(new List<Panel>() { panel1});

//// Pull it
//FilterRequest panelFilter = new FilterRequest() { Type = typeof(Panel) };
//var panelPulled = adapter.Pull(panelFilter).ToList();
//Panel pp = (Panel)panelPulled[0];
FilterRequest panelFilter = new FilterRequest() { Type = typeof(Panel) };
var panelPulled = adapter.Pull(panelFilter).ToList();
Panel pp = (Panel)panelPulled[0];

//// Check
//Assert.IsNotNull(pp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void InitializeOpenings()
[SetUp]
public void SetUp()
{
adapter.Push(new List<Panel>() { panel1, panel2, panel3 });
//adapter.Push(new List<Panel>() { panel1, panel2, panel3 });
}


Expand Down Expand Up @@ -268,7 +268,19 @@ public void PushOfReversedAreaUniformlyDistributedLoad()
Assert.True(this.reverseAreaLoadList[i].Axis.Equals(areaLoadList[i].Axis));
}

[Test]
public void PullUniformlyDistributedLoad()
{

//Act

// Push

// Pull
FilterRequest loadFilter = new FilterRequest() { Type = typeof(AreaUniformlyDistributedLoad) };
List<AreaUniformlyDistributedLoad> areaLoadList = adapter.Pull(loadFilter).ToList().Select(p => (AreaUniformlyDistributedLoad)p).ToList();
var a = areaLoadList.First();
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,52 +36,74 @@ namespace RFEM_Toolkit_Test.Elements
{


public class BarResultTestClass
public class BarResultTestClass

{
{

RFEM6Adapter adapter;
RFEM6Adapter adapter;

//[TearDown]
//public void TearDown()
//{
// adapter.Wipeout();
//}
//[TearDown]
//public void TearDown()
//{
// adapter.Wipeout();
//}

[OneTimeSetUp]
public void InitializeRFEM6Adapter()
{
adapter = new RFEM6Adapter(active:true);
[OneTimeSetUp]
public void InitializeRFEM6Adapter()
{
adapter = new RFEM6Adapter(active: true);

}
}

[Test]
public void ReadResult()
{
List<LoadCombination?> loadCombList = adapter.Pull(new FilterRequest() { Type = typeof(LoadCombination) }).Select(l=> l as LoadCombination).ToList();
[Test]
public void ReadResult()
{
List<LoadCombination?> loadCombList = adapter.Pull(new FilterRequest() { Type = typeof(LoadCombination) }).Select(l => l as LoadCombination).ToList();

Loadcase loadcase1 = new Loadcase() { Name = "LC1", Nature = LoadNature.Dead, Number = 1 };
LoadCombination loadCombination = new LoadCombination { Name = "LoadCombination1", Number = 1 };
Loadcase loadcase1 = new Loadcase() { Name = "LC1", Nature = LoadNature.Dead, Number = 1 };
LoadCombination loadCombination = new LoadCombination { Name = "LoadCombination1", Number = 1 };

BarResultRequest request = new BarResultRequest();
BarResultRequest request = new BarResultRequest();

request.ResultType = BarResultType.BarForce;
request.DivisionType = DivisionType.EvenlyDistributed;
request.Divisions = 3;
request.Cases = new List<Object> { loadCombList.First() };
//request.Cases = new List<Object> {1};
request.Modes = new List<string>();
request.ObjectIds = new List<object> {1};
//request.ObjectIds = new List<object> {1,2,3,4};
request.ResultType = BarResultType.BarForce;
request.DivisionType = DivisionType.EvenlyDistributed;
request.Divisions = 3;
request.Cases = new List<Object> { loadCombList.First() };
//request.Cases = new List<Object> {1};
request.Modes = new List<string>();
request.ObjectIds = new List<object> { 1 };
//request.ObjectIds = new List<object> {1,2,3,4};

var obj = adapter.Pull(request);
var obj = adapter.Pull(request);

obj.First();
obj.First();

}
}

[Test]
public void ReadResult2()
{
List<LoadCombination?> loadCombList = adapter.Pull(new FilterRequest() { Type = typeof(LoadCombination) }).Select(l => l as LoadCombination).ToList();
List<LoadCombination?> relevantLoadComb = loadCombList.Take(38).ToList();

BarResultRequest request = new BarResultRequest();

}
request.ResultType = BarResultType.BarForce;
request.DivisionType = DivisionType.EvenlyDistributed;
request.Divisions = 2;
request.Cases = new List<Object> {relevantLoadComb.First()};
request.Modes = new List<string>();
//request.ObjectIds = new List<object> { 1 };
//request.ObjectIds = new List<object> {1,2,3,4};

var obj = adapter.Pull(request);


var obj_first = obj.First();
}



}
}

4 changes: 2 additions & 2 deletions .ci/unit-tests/RFEM_Toolkit_Test/RFEM_Toolkit_Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<Description>https://github.com/BHoM/RFEM6_Toolkit</Description>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<FileVersion>8.3.0.0</FileVersion>
<FileVersion>9.0.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
22 changes: 22 additions & 0 deletions RFEM6_Adapter/CRUD/Create/BHoMDataStructure/Loading/Load.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@
//Container for Potential Surface IDs. Surface IDs are onle relevant when using Free Line Loads
int[] surfaceIds = new int[] { };

foreach (ILoad bhLoad in bhLoads)
{


if (bhLoad is AreaUniformlyDistributedLoad)
{
if (bhLoad.CustomData.Values.Any(l=>l is Polygon)) {
CreateLoad_Polygon(bhLoad as AreaUniformlyDistributedLoad);
continue;
}

Check warning on line 67 in RFEM6_Adapter/CRUD/Create/BHoMDataStructure/Loading/Load.cs

View check run for this annotation

BHoMBot-CI / beta-code-compliance

RFEM6_Adapter/CRUD/Create/BHoMDataStructure/Loading/Load.cs#L64-L67

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData
CreateLoad(bhLoad as AreaUniformlyDistributedLoad);
continue;
}

Check warning on line 70 in RFEM6_Adapter/CRUD/Create/BHoMDataStructure/Loading/Load.cs

View check run for this annotation

BHoMBot-CI / beta-code-compliance

RFEM6_Adapter/CRUD/Create/BHoMDataStructure/Loading/Load.cs#L62-L70

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData
Expand Down Expand Up @@ -233,6 +237,24 @@

}

private void CreateLoad_Polygon(AreaUniformlyDistributedLoad bhLoad)
{
try
{
UpdateLoadIdDictionary(bhLoad);
//Call Panel Load Methond to update the Panel ID Dictionary
this.GetCachedOrReadAsDictionary<int, Panel>();
int id = m_LoadcaseLoadIdDict[bhLoad.Loadcase][bhLoad.GetType().Name];
free_polygon_load rfemAreaLoad = (bhLoad as AreaUniformlyDistributedLoad).ToRFEM6_Polygon(id);
var currrSurfaceIds = (bhLoad as AreaUniformlyDistributedLoad).Objects.Elements.ToList().Select(e => m_PanelIDdict[e as Panel]).ToArray();
rfemAreaLoad.surfaces = currrSurfaceIds;
m_Model.set_free_polygon_load(bhLoad.Loadcase.Number, rfemAreaLoad);

} catch (Exception ex) {
BH.Engine.Base.Compute.RecordError($"The creation of {bhLoad} failed.\nA potential cause is that the applied polygon is non-planar or not parallel to the XY, YZ, or ZX plane.\nException: {ex.Message}\nStackTrace: {ex.StackTrace}");
}
}

private void CreateLoad(BarUniformlyDistributedLoad bhLoad)
{

Expand Down
5 changes: 3 additions & 2 deletions RFEM6_Adapter/CRUD/Read/BHoMDataStructure/Geometry/Bar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ private List<Bar> ReadBars(List<string> ids = null)
foreach (var rfMember in allRfMembers)
{


Node node0 = null;
nodes.TryGetValue(rfMember.nodes[0], out node0);
nodes.TryGetValue(rfMember.node_start, out node0);

Node node1 = null;
nodes.TryGetValue(rfMember.nodes[1], out node1);
nodes.TryGetValue(rfMember.node_end, out node1);

ISectionProperty section = null;
sections.TryGetValue(rfMember.section_end, out section);
Expand Down
30 changes: 27 additions & 3 deletions RFEM6_Adapter/CRUD/Read/BHoMDataStructure/Loading/Load.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ private List<ILoad> ReadPointLoad(List<string> ids = null)

private List<ILoad> ReadAreaLoad(List<string> ids = null)
{

List<ILoad> loads = new List<ILoad>();

//Find all possible Load cases
Expand All @@ -136,18 +137,41 @@ private List<ILoad> ReadAreaLoad(List<string> ids = null)

if (!(surfaceLoad.load_distribution is rfModel.surface_load_load_distribution.LOAD_DISTRIBUTION_UNIFORM))
{
Engine.Base.Compute.RecordNote("The current RFEM6 includes Surfaceloads with a non-uniformal load distributeion, these Loads will not be pulled.");
Engine.Base.Compute.RecordNote("The current RFEM6 includes Surface loads with a non-uniformal load distributeion, these Loads will not be pulled.");
continue;
}

loads.Add(surfaceLoad.FromRFEM(loadCaseMap[surfaceLoad.load_case], panels));

}

return loads;

rfModel.object_with_children[] numbers_ = m_Model.get_all_object_numbers_by_type(rfModel.object_types.E_OBJECT_TYPE_FREE_POLYGON_LOAD);

//IEnumerable<rfModel.surface_load> foundSurfaceLoad = numbers.ToList().Select(n => m_Model.get_surface_load(n.children[0], n.no));
IEnumerable<rfModel.free_polygon_load> foundPolygonLoad_ = numbers_.SelectMany(n => n.children.Select(child => m_Model.get_free_polygon_load(child, n.no)));

foundPolygonLoad_ = foundPolygonLoad_.OrderBy(n => n.load_case).ThenBy(t => t.no);
foreach (rfModel.free_polygon_load polygonLoad in foundPolygonLoad_)
{
List<Panel> panels = polygonLoad.surfaces.ToList().Select(s => panelMap[s]).ToList();
if (!(polygonLoad.load_distribution is rfModel.free_polygon_load_load_distribution.LOAD_DISTRIBUTION_UNIFORM))
{
Engine.Base.Compute.RecordNote("The current RFEM6 includes Surface loads with a non-uniformal load distributeion, these Loads will not be pulled.");
continue;
}

loads.Add(polygonLoad.FromRFEM(loadCaseMap[polygonLoad.load_case], panels));

}


return loads;
}

private List<ILoad> ReadFreeLineLoad(List<string> ids = null)


private List<ILoad> ReadFreeLineLoad(List<string> ids = null)
{
List<ILoad> loads = new List<ILoad>();

Expand Down
Loading