Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 21 additions & 2 deletions Robot_Adapter/CRUD/Create/Loads/LoadCombination.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*/

using System.Collections.Generic;
using BH.Engine.Base;
using BH.oM.Adapters.Robot;
using BH.oM.Structure.Loads;
using RobotOM;

Expand All @@ -41,9 +43,26 @@ private bool CreateCollection(IEnumerable<LoadCombination> lComabinations)
if (!CheckNotNull(lComb))
continue;

if (m_RobotApplication.Project.Structure.Cases.Exist(lComb.Number)!=-1)
IRobotCombinationType robotCombinationType = IRobotCombinationType.I_CBT_ULS;

//Assign IRobotCombinationType based on the CombinationType fragment
LoadCombinationType combTypeFragment = lComb.FindFragment<LoadCombinationType>();
if (combTypeFragment == null)
{
BH.Engine.Base.Compute.RecordWarning($"LoadCombination {lComb.Number} does not have a LoadCombinationType fragment. Defaulting to Eurocode ULS.");
}
else if (combTypeFragment.CombinationType == CombinationType.EC_ULS)
{
robotCombinationType = IRobotCombinationType.I_CBT_ULS;
}
else if (combTypeFragment.CombinationType == CombinationType.EC_SLS)
{
robotCombinationType = IRobotCombinationType.I_CBT_SLS;
}

if (m_RobotApplication.Project.Structure.Cases.Exist(lComb.Number) != -1)
{
RobotCaseCombination rCaseCombination = m_RobotApplication.Project.Structure.Cases.CreateCombination(lComb.Number, lComb.Name, IRobotCombinationType.I_CBT_ULS, IRobotCaseNature.I_CN_PERMANENT, IRobotCaseAnalizeType.I_CAT_COMB);
RobotCaseCombination rCaseCombination = m_RobotApplication.Project.Structure.Cases.CreateCombination(lComb.Number, lComb.Name, robotCombinationType, IRobotCaseNature.I_CN_PERMANENT, IRobotCaseAnalizeType.I_CAT_COMB);
for (int i = 0; i < lComb.LoadCases.Count; i++)
{
//Check tuple as well as case not null
Expand Down
21 changes: 18 additions & 3 deletions Robot_Adapter/Convert/ToRobot/Loads/ContourLoad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using BH.Engine.Base;
using BH.Engine.Geometry;
using BH.oM.Adapters.Robot;
using BH.oM.Geometry;
using BH.oM.Structure.Loads;
using RobotOM;
Expand Down Expand Up @@ -54,11 +56,24 @@ public static void ToRobot(this ContourLoad load, RobotSimpleCase sCase, RobotGr
if (points.First().SquareDistance(points.Last()) < Tolerance.Distance * Tolerance.Distance)
points.RemoveAt(points.Count - 1);

List<int> contPanelNumbers = load.FindFragment<ContourLoadPanelNumbers>()?.PanelNumbers;

if (contPanelNumbers == null)
{
// If no panel numbers are provided, Robot will auto-detect objects
loadRecord.SetValue((short)IRobotInContourRecordValues.I_ICRV_AUTO_DETECT_OBJECTS, 1);
}
else
{
// If panel numbers are provided, convert them to a string and set the objects
loadRecord.Objects.FromText(ToRobotSelectionString(contPanelNumbers));
}

loadRecord.SetValue((short)IRobotInContourRecordValues.I_ICRV_PX1, load.Force.X);
loadRecord.SetValue((short)IRobotInContourRecordValues.I_ICRV_PY1, load.Force.Y);
loadRecord.SetValue((short)IRobotInContourRecordValues.I_ICRV_PZ1, load.Force.Z);
loadRecord.SetValue((short)IRobotInContourRecordValues.I_ICRV_NPOINTS, points.Count);
loadRecord.SetValue((short)IRobotInContourRecordValues.I_ICRV_AUTO_DETECT_OBJECTS, 1);

loadRecord.SetValue((short)IRobotInContourRecordValues.I_ICRV_LOCAL, (load.Axis == LoadAxis.Global) ? 0 : 1);
loadRecord.SetValue((short)IRobotInContourRecordValues.I_ICRV_PROJECTION, load.Projected ? 1 : 0);

Expand All @@ -67,8 +82,8 @@ public static void ToRobot(this ContourLoad load, RobotSimpleCase sCase, RobotGr

for (int cp = 0; cp < points.Count; cp++)
{
loadRecord.SetContourPoint(cp +1, points[cp].X, points[cp].Y, points[cp].Z);
}
loadRecord.SetContourPoint(cp + 1, points[cp].X, points[cp].Y, points[cp].Z);
}
}

/***************************************************/
Expand Down
53 changes: 53 additions & 0 deletions Robot_oM/Enums/CombinationType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
*
*
* The BHoM is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3.0 of the License, or
* (at your option) any later version.
*
* The BHoM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using BH.oM.Base.Attributes;
using System.ComponentModel;

namespace BH.oM.Adapters.Robot
{
/***************************************************/
/**** Public Enums ****/
/***************************************************/

public enum CombinationType
{
Undefined,

[Description("Eurocode - Ultimate Limit State")]
[DisplayText("Ultimate Limit State")]
EC_ULS, // Ultimate Limit State

[Description("Eurocode - Serviceability Limit State")]
[DisplayText("Serviceability Limit State")]
EC_SLS, // Serviceability Limit State
}

/***************************************************/

}






41 changes: 41 additions & 0 deletions Robot_oM/Fragments/ContourLoadPanelNumbers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
*
*
* The BHoM is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3.0 of the License, or
* (at your option) any later version.
*
* The BHoM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BH.oM.Base;

namespace BH.oM.Adapters.Robot
{
public class ContourLoadPanelNumbers : IFragment
{
public virtual List<int> PanelNumbers { get; set; } = null;
}
}





41 changes: 41 additions & 0 deletions Robot_oM/Fragments/LoadCombinationType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
*
*
* The BHoM is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3.0 of the License, or
* (at your option) any later version.
*
* The BHoM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BH.oM.Base;

namespace BH.oM.Adapters.Robot
{
public class LoadCombinationType : IFragment
{
public virtual CombinationType CombinationType { get; set; } = 0;
}
}





5 changes: 4 additions & 1 deletion Robot_oM/Robot_oM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Enums\CombinationType.cs" />
<Compile Include="Enums\DesignCode_Steel.cs" />
<Compile Include="Enums\MaterialDB.cs" />
<Compile Include="Enums\SectionDB.cs" />
<Compile Include="Fragments\ContourLoadPanelNumbers.cs" />
<Compile Include="Fragments\LoadCombinationType.cs" />
<Compile Include="Fragments\LoadCaseLabel.cs" />
<Compile Include="Fragments\PanelFiniteElementIds.cs" />
<Compile Include="Fragments\RobotId.cs" />
Expand Down Expand Up @@ -98,4 +101,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>