Skip to content
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
497757c
Create ETABSGroup.cs class in ETABS_oM
GCRA101 Oct 28, 2025
4dd775a
Delete ETABSGroup.cs
GCRA101 Oct 29, 2025
915b00f
Add SetGroup Method to Create/Bar.cs
GCRA101 Oct 29, 2025
c63a3ab
Add Support for Group Feature for Push/Pull of Nodes
GCRA101 Oct 29, 2025
49a09c9
Add Support for Group Feature for Push of Bars
GCRA101 Oct 29, 2025
bed45c9
Add Support for Group Feature for Push/Pull of Links
GCRA101 Oct 29, 2025
e7a1d78
Add Support for Group Feature for Push/Pull of Panels
GCRA101 Oct 29, 2025
c12c00f
Add Support for Group Feature for Push/Pull of Openings
GCRA101 Oct 29, 2025
fc85629
Fix Support of Group feature in Push for Links, Openings and Panels
GCRA101 Oct 29, 2025
16139fb
Add UpdateGroup Feature for Bars
GCRA101 Oct 29, 2025
4c16477
Add UpdateGroup feature for Nodes
GCRA101 Oct 29, 2025
781c2d9
Add UpdateGroup feature for Panels
GCRA101 Oct 29, 2025
6118b76
Add UpdateGroup Feature for Links
GCRA101 Oct 29, 2025
ba206b3
Add UpdateGroup Feature for Openings
GCRA101 Oct 29, 2025
5bbdafe
Prevent UpdateGroup() method form running with ETABS v16 and v17.
GCRA101 Nov 4, 2025
d1a0f25
Fix syntax error in Update/Bar.cs
GCRA101 Nov 4, 2025
3246f23
Add missing logic preventing UpdateGroup() method from running with E…
GCRA101 Nov 4, 2025
fb0f89e
Fix bug panel.Tags.Add() with non perfectly vertical panels
GCRA101 Nov 20, 2025
497fa32
Replace type-specific SetGroup methods with one for generic BHoMObjec…
GCRA101 Dec 8, 2025
d7d3988
Replace type-specific ResetGroup methods with one for generic BHoMObj…
GCRA101 Dec 8, 2025
aa299a2
Remove Distinct() from groupNames assignment
GCRA101 Dec 15, 2025
d5133e7
Fix mistake group assigment to nodes/bars.
GCRA101 Dec 16, 2025
c97bc9e
Merge branch 'develop' into ETABS_Toolkit-#509-AddSupportForGroups
GCRA101 Jan 5, 2026
81e1e84
Resolve copyright compliance
BHoMBot Jan 7, 2026
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
44 changes: 43 additions & 1 deletion Etabs_Adapter/CRUD/Create/Bar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private bool CreateObject(Bar bhBar)

bhBar.SetAdapterId(etabsIdFragment);

return SetObject(bhBar);
return SetObject(bhBar) && SetGroup(bhBar);
}

/***************************************************/
Expand Down Expand Up @@ -215,6 +215,48 @@ private bool SetObject(Bar bhBar)

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

private bool SetGroup(Bar bhBar)
{
int ret = 0;
/* Get the ETABS name of the Bar */
string name = GetAdapterId<string>(bhBar);

try {
/* Get the list of unique groupNames assigned to the BHoM Bar */
List<string> groupNames = bhBar.Tags.Distinct().ToList();
/* Get the list of existing group names in the ETABS model */
int modelNumGroups = 0;
string[] modelGroupNames = null;
m_model.GroupDef.GetNameList(ref modelNumGroups, ref modelGroupNames);

/* Create any groups that do not already exist in the ETABS model */
foreach (string groupName in groupNames)
{
if (!modelGroupNames.Contains(groupName))
{
ret = m_model.GroupDef.SetGroup_1(groupName);
if (ret != 0)
{
Engine.Base.Compute.RecordError("Could not create the Group <" + groupName + "> assigned to the Bar. Group not created.");
return false;
}
}
}

/* Assign the Bar to each group in the list */
groupNames.ToList().ForEach(groupName => m_model.FrameObj.SetGroupAssign(name, groupName));
}
catch (Exception e)
{
Engine.Base.Compute.RecordError("Could not assign input groups to the bar. Groups not assigned.");
return false;
}

return true;
}

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

#if Debug16 || Release16

[Description("Returns a bar where the endpoints have been flipped without cloning the object")]
Expand Down
58 changes: 53 additions & 5 deletions Etabs_Adapter/CRUD/Create/Link.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using System.Collections.Generic;
using System.Linq;
using BH.Engine.Adapter;
using BH.Engine.Adapters.ETABS;
using BH.Engine.Structure;
using BH.oM.Adapters.ETABS;
using BH.oM.Structure.Elements;
using BH.oM.Structure.Constraints;
using BH.Engine.Structure;
using BH.Engine.Adapters.ETABS;
using BH.oM.Structure.Elements;
using System;
using System.Collections.Generic;
using System.Linq;


namespace BH.Adapter.ETABS
Expand Down Expand Up @@ -70,6 +71,8 @@ private bool CreateObject(RigidLink bhLink)
multiId.Id = linkIds;
bhLink.SetAdapterId(multiId);

SetGroup(bhLink);

return success;
}

Expand Down Expand Up @@ -106,6 +109,51 @@ private bool CreateObject(LinkConstraint bhLinkConstraint)
}

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

private bool SetGroup(RigidLink bhLink)
{
int ret = 0;
/* Get the ETABS names of all the Links */
List<string> names = ((ETABSId)bhLink.Fragments[0]).Id as List<string>;

try
{
/* Get the list of unique groupNames assigned to the BHoM Link */
List<string> groupNames = bhLink.Tags.Distinct().ToList();
/* Get the list of existing group names in the ETABS model */
int modelNumGroups = 0;
string[] modelGroupNames = null;
m_model.GroupDef.GetNameList(ref modelNumGroups, ref modelGroupNames);

/* Create any groups that do not already exist in the ETABS model */
foreach (string groupName in groupNames)
{
if (!modelGroupNames.Contains(groupName))
{
ret = m_model.GroupDef.SetGroup_1(groupName);
if (ret != 0)
{
Engine.Base.Compute.RecordError("Could not create the Group <" + groupName + "> assigned to the Link. Group not created.");
return false;
}
}
}

/* Assign the Links to each group in the list */
foreach (string name in names) {
groupNames.ToList().ForEach(groupName => m_model.LinkObj.SetGroupAssign(name, groupName));
}
}
catch (Exception e)
{
Engine.Base.Compute.RecordError("Could not assign input groups to the link. Groups not assigned.");
return false;
}

return true;
}

/***************************************************/
}
}

Expand Down
55 changes: 50 additions & 5 deletions Etabs_Adapter/CRUD/Create/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using System.Collections.Generic;
using System.Linq;
using BH.Engine.Adapter;
using BH.oM.Adapters.ETABS;
using BH.oM.Structure.Elements;
using BH.Engine.Structure;
using BH.Engine.Adapters.ETABS;
using BH.Engine.Geometry;
using BH.Engine.Structure;
using BH.oM.Adapters.ETABS;
using BH.oM.Geometry;
using BH.oM.Structure.Elements;
using System;
using System.Collections.Generic;
using System.Linq;

namespace BH.Adapter.ETABS
{
Expand Down Expand Up @@ -69,6 +70,7 @@ private bool CreateObject(Node bhNode)

bhNode.SetAdapterId(etabsid);
SetObject(bhNode, name);
SetGroup(bhNode);
}

return true;
Expand Down Expand Up @@ -106,6 +108,49 @@ private bool SetObject(Node bhNode, string name)
}

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

private bool SetGroup(Node bhNode)
{
int ret = 0;
/* Get the ETABS name of the Node */
string name = GetAdapterId<string>(bhNode);

try
{
/* Get the list of unique groupNames assigned to the BHoM Node */
List<string> groupNames = bhNode.Tags.Distinct().ToList();
/* Get the list of existing group names in the ETABS model */
int modelNumGroups = 0;
string[] modelGroupNames = null;
m_model.GroupDef.GetNameList(ref modelNumGroups, ref modelGroupNames);

/* Create any groups that do not already exist in the ETABS model */
foreach (string groupName in groupNames)
{
if (!modelGroupNames.Contains(groupName))
{
ret = m_model.GroupDef.SetGroup_1(groupName);
if (ret != 0)
{
Engine.Base.Compute.RecordError("Could not create the Group <" + groupName + "> assigned to the Node. Group not created.");
return false;
}
}
}

/* Assign the Node to each group in the list */
groupNames.ToList().ForEach(groupName => m_model.PointObj.SetGroupAssign(name, groupName));
}
catch (Exception e)
{
Engine.Base.Compute.RecordError("Could not assign input groups to the node. Groups not assigned.");
return false;
}

return true;
}

/***************************************************/
}
}

Expand Down
61 changes: 54 additions & 7 deletions Etabs_Adapter/CRUD/Create/Opening.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using System.Collections.Generic;
using System.Linq;
using BH.Engine.Adapter;
using BH.oM.Adapters.ETABS;
using BH.oM.Structure.Elements;
using BH.Engine.Structure;
using BH.Engine.Adapters.ETABS;
using BH.Engine.Geometry;
using BH.Engine.Spatial;
using BH.Engine.Adapters.ETABS;
using BH.Engine.Structure;
using BH.oM.Adapters.ETABS;
using BH.oM.Adapters.ETABS.Elements;
using BH.oM.Geometry;
using BH.oM.Analytical.Elements;
using BH.oM.Geometry;
using BH.oM.Structure.Elements;
using System;
using System.Collections.Generic;
using System.Linq;


namespace BH.Adapter.ETABS
Expand Down Expand Up @@ -105,10 +106,56 @@ private bool CreateObject(Opening bhOpening)

m_model.AreaObj.SetOpening(openingName, true);

//Set Groups Assignment
SetGroup(bhOpening);

return success;
}

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

private bool SetGroup(Opening bhOpening)
{
int ret = 0;
/* Get the ETABS name of the Opening */
string name = GetAdapterId<string>(bhOpening);

try
{
/* Get the list of unique groupNames assigned to the BHoM Opening */
List<string> groupNames = bhOpening.Tags.Distinct().ToList();
/* Get the list of existing group names in the ETABS model */
int modelNumGroups = 0;
string[] modelGroupNames = null;
m_model.GroupDef.GetNameList(ref modelNumGroups, ref modelGroupNames);

/* Create any groups that do not already exist in the ETABS model */
foreach (string groupName in groupNames)
{
if (!modelGroupNames.Contains(groupName))
{
ret = m_model.GroupDef.SetGroup_1(groupName);
if (ret != 0)
{
Engine.Base.Compute.RecordError("Could not create the Group <" + groupName + "> assigned to the Opening. Group not created.");
return false;
}
}
}

/* Assign the Opening to each group in the list */
groupNames.ToList().ForEach(groupName => m_model.AreaObj.SetGroupAssign(name, groupName));
}
catch (Exception e)
{
Engine.Base.Compute.RecordError("Could not assign input groups to the openings. Groups not assigned.");
return false;
}

return true;
}

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

}
}
60 changes: 54 additions & 6 deletions Etabs_Adapter/CRUD/Create/Panel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using System.Collections.Generic;
using System.Linq;
using BH.Engine.Adapter;
using BH.oM.Adapters.ETABS;
using BH.oM.Structure.Elements;
using BH.Engine.Structure;
using BH.Engine.Adapters.ETABS;
using BH.Engine.Geometry;
using BH.Engine.Spatial;
using BH.Engine.Adapters.ETABS;
using BH.Engine.Structure;
using BH.oM.Adapters.ETABS;
using BH.oM.Adapters.ETABS.Elements;
using BH.oM.Geometry;
using BH.oM.Structure.Elements;
using System;
using System.Collections.Generic;
using System.Linq;


namespace BH.Adapter.ETABS
Expand Down Expand Up @@ -175,6 +176,10 @@ private bool CreateObject(Panel bhPanel)
{
m_model.AreaObj.SetDiaphragm(name, diaphragm.Name);
}

//Set Groups Assignment
SetGroup(bhPanel);

return success;
}

Expand All @@ -200,6 +205,49 @@ private static void NonLinearEdgesCheck(List<Edge> edges)

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

private bool SetGroup(Panel bhPanel)
{
int ret = 0;
/* Get the ETABS name of the Panel */
string name = GetAdapterId<string>(bhPanel);

try
{
/* Get the list of unique groupNames assigned to the BHoM Panel */
List<string> groupNames = bhPanel.Tags.Distinct().ToList();
/* Get the list of existing group names in the ETABS model */
int modelNumGroups = 0;
string[] modelGroupNames = null;
m_model.GroupDef.GetNameList(ref modelNumGroups, ref modelGroupNames);

/* Create any groups that do not already exist in the ETABS model */
foreach (string groupName in groupNames)
{
if (!modelGroupNames.Contains(groupName))
{
ret = m_model.GroupDef.SetGroup_1(groupName);
if (ret != 0)
{
Engine.Base.Compute.RecordError("Could not create the Group <" + groupName + "> assigned to the Panel. Group not created.");
return false;
}
}
}

/* Assign the Panel to each group in the list */
groupNames.ToList().ForEach(groupName => m_model.AreaObj.SetGroupAssign(name, groupName));
}
catch (Exception e)
{
Engine.Base.Compute.RecordError("Could not assign input groups to the panel. Groups not assigned.");
return false;
}

return true;
}

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

}
}

Expand Down
Loading