Skip to content
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
23 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
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
3 changes: 2 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,7 @@ private bool SetObject(Bar bhBar)

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


#if Debug16 || Release16

[Description("Returns a bar where the endpoints have been flipped without cloning the object")]
Expand Down
14 changes: 9 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,7 @@ private bool CreateObject(LinkConstraint bhLinkConstraint)
}

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

}
}

Expand Down
13 changes: 8 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,7 @@ private bool SetObject(Node bhNode, string name)
}

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

}
}

Expand Down
18 changes: 11 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,6 +106,9 @@ private bool CreateObject(Opening bhOpening)

m_model.AreaObj.SetOpening(openingName, true);

//Set Groups Assignment
SetGroup(bhOpening);

return success;
}

Expand Down
17 changes: 11 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 Down
68 changes: 62 additions & 6 deletions Etabs_Adapter/CRUD/Create/_Create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,23 @@
* 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.oM.Structure.Elements;
using BH.Engine.Adapters.ETABS;
using BH.oM.Adapters.ETABS.Elements;
using BH.oM.Adapter;
using BH.oM.Adapters.ETABS;
using BH.oM.Adapters.ETABS.Elements;
using BH.oM.Analytical.Elements;
using BH.oM.Analytical.Results;
using BH.oM.Base;
using BH.oM.Structure.Constraints;
using BH.oM.Structure.Elements;
using BH.oM.Structure.Loads;
using BH.oM.Structure.MaterialFragments;
using BH.oM.Structure.SectionProperties;
using BH.oM.Structure.SurfaceProperties;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;

namespace BH.Adapter.ETABS
{
Expand Down Expand Up @@ -109,11 +119,57 @@ private bool CreateObject(IBHoMObject obj)

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

}
}
private bool SetGroup(BHoMObject obj)
{
int ret = 0;
Type type = obj.GetType();
string objName = "";

/* 1. CHECK ASSIGNED GROUPS */

/* Get the list of unique groupNames assigned to the BHoM Bar */
List<string> groupNames = obj.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 Object. Group not created.");
return false;
}
}
}

/* 2. ASSIGN OBJECT TO GROUPS */

if (type == typeof(RigidLink)) {
/* Get the ETABS names of all the Links */
List<string> names = ((ETABSId)obj.Fragments[0]).Id as List<string>;
/* Assign the Links to each group in the list */
foreach (string name in names) { groupNames.ToList().ForEach(groupName => m_model.LinkObj.SetGroupAssign(name, groupName)); }
} else {
/* Get the ETABS name of the Object */
objName = GetAdapterId<string>(obj);
/* Assign the Object to each group in the list */
if (type == typeof(Node)) groupNames.ToList().ForEach(groupName => m_model.FrameObj.SetGroupAssign(objName, groupName));
if (type == typeof(Bar)) groupNames.ToList().ForEach(groupName => m_model.PointObj.SetGroupAssign(objName, groupName));
if (type == typeof(Panel) || type == typeof(Opening)) groupNames.ToList().ForEach(groupName => m_model.AreaObj.SetGroupAssign(objName, groupName));

}

return true;
}

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

}

}
13 changes: 13 additions & 0 deletions Etabs_Adapter/CRUD/Read/Link.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,19 @@ private List<RigidLink> ReadRigidLink(List<string> ids = null)

bhLink.Constraint = new LinkConstraint { Name = propName }; //Dummy constraint to be populated in later loop

/* Get the ETABS name of the Rigid Link */
string name = GetAdapterId<string>(bhLink);

#if !(Debug16 || Release16 || Debug17 || Release17)
// Get the groups the link is assigned to
int numGroups = 0;
string[] groupNames = new string[0];
if (m_model.LinkObj.GetGroupAssign(name, ref numGroups, ref groupNames) == 0)
{
foreach (string grpName in groupNames)
bhLink.Tags.Add(grpName);
}
#endif
linkList.Add(bhLink);
}

Expand Down
13 changes: 12 additions & 1 deletion Etabs_Adapter/CRUD/Read/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,18 @@ private List<Node> ReadNode(List<string> ids = null)
etabsIdFragment.Story = story;
}

if(m_model.PointObj.GetGUID(id, ref guid) == 0)
#if !(Debug16 || Release16 || Debug17 || Release17)
// Get the groups the bar is assigned to
int numGroups = 0;
string[] groupNames = new string[0];
if (m_model.PointObj.GetGroupAssign(id, ref numGroups, ref groupNames) == 0)
{
foreach (string grpName in groupNames)
bhNode.Tags.Add(grpName);
}
#endif

if (m_model.PointObj.GetGUID(id, ref guid) == 0)
etabsIdFragment.PersistentId = guid;

bhNode.SetAdapterId(etabsIdFragment);
Expand Down
30 changes: 21 additions & 9 deletions Etabs_Adapter/CRUD/Read/Opening.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

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


namespace BH.Adapter.ETABS
Expand Down Expand Up @@ -91,6 +92,17 @@ private List<Opening> ReadOpening(List<string> ids = null)
etabsId.Story = story;
}

#if !(Debug16 || Release16 || Debug17 || Release17)
// Get the groups the opening is assigned to
int numGroups = 0;
string[] groupNames = new string[0];
if (m_model.AreaObj.GetGroupAssign(id, ref numGroups, ref groupNames) == 0)
{
foreach (string grpName in groupNames)
opening.Tags.Add(grpName);
}
#endif

if (m_model.AreaObj.GetGUID(id, ref guid) == 0)
etabsId.PersistentId = guid;

Expand Down
14 changes: 14 additions & 0 deletions Etabs_Adapter/CRUD/Read/Panel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ private List<Panel> ReadPanel(List<string> ids = null)
etabsId.Story = story;
}

#if !(Debug16 || Release16 || Debug17 || Release17)

if (panel != null) {
// Get the groups the panel is assigned to
int numGroups = 0;
string[] groupNames = new string[0];
if (m_model.AreaObj.GetGroupAssign(id, ref numGroups, ref groupNames) == 0)
{
foreach (string grpName in groupNames)
panel.Tags.Add(grpName);
}
}
#endif

if (m_model.AreaObj.GetGUID(id, ref guid) == 0)
etabsId.PersistentId = guid;

Expand Down
7 changes: 6 additions & 1 deletion Etabs_Adapter/CRUD/Update/Bar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,14 @@ private bool UpdateObjects(IEnumerable<Bar> bhBars)
"To update the connectivity or position of a Bar, delete the existing Bar you want to update and create a new one.");
}
#endif

#if Debug16 || Release16 || Debug17 || Release17
if (SetObject(bhBar))
ret++;
#else
if (SetObject(bhBar) && UpdateGroup(bhBar))
ret++;
#endif


}

Expand Down
Loading