Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
46ed55c
Add folder libs/ with dll for v26
GCRA101 Dec 15, 2025
aabda22
Move CSiAPIv1.dll to libs/ v26/ folder
GCRA101 Feb 12, 2026
4c2e296
Update project compliance
BHoMBot Feb 17, 2026
b76420b
Remove unused nuget packages
GCRA101 Feb 19, 2026
1dd9559
Fix reference to SAP2000v1.dll in .csproj files
GCRA101 Feb 19, 2026
4134984
Update assembly file version to 9.3.0.0
BHoMBot Jul 6, 2026
ac232b6
Start of milestone changes for 9.3 (#341)
peterjamesnugent Jul 9, 2026
ba6b727
Add folder libs/ with dll for v26
GCRA101 Dec 15, 2025
1a24101
Move CSiAPIv1.dll to libs/ v26/ folder
GCRA101 Feb 12, 2026
2534571
Update project compliance
BHoMBot Feb 17, 2026
2b7f6ee
Remove unused nuget packages
GCRA101 Feb 19, 2026
addc1b1
Fix reference to SAP2000v1.dll in .csproj files
GCRA101 Feb 19, 2026
befddda
Track SAP2000 v26 interop DLLs in libs/v26/
GCRA101 Jul 13, 2026
f8251ff
Merge branch 'SAP2000_Toolkit-#318-SupportVersionV26' of https://gith…
BHoMBot Jul 14, 2026
d4f180d
Update project compliance
BHoMBot Jul 14, 2026
199512f
Set versioned DLL refs to copy locally
GCRA101 Jul 14, 2026
842ed1b
Update .gitignore
GCRA101 Jul 16, 2026
1cd8fbf
Remove unused ref to SAP2000v1.dll from Engine.csproj
GCRA101 Jul 16, 2026
0f69bbd
Support Version v26 (#334)
peterjamesnugent Jul 17, 2026
dcb6732
Use success bool parameter in ICreate<T>
GCRA101 Jul 17, 2026
1eddde9
Add SetUniqueName Method in _ICreate.cs
GCRA101 Jul 17, 2026
66a52b2
Implement SetUniqueName in Create/Bar.cs
GCRA101 Jul 20, 2026
c5df7a5
Implement SetUniqueName in Create/Node.cs
GCRA101 Jul 20, 2026
02fbdff
Implement SetUniqueName in Create/Panel.cs
GCRA101 Jul 20, 2026
a312a82
Create SetUniqueName specific for Rigid Links
GCRA101 Jul 20, 2026
9f98d5c
Add UpdateUniqueName in _IUpdate.cs
GCRA101 Jul 20, 2026
b85e3b9
Implement UpdateUniqueName for Nodes and Bars
GCRA101 Jul 20, 2026
c1026c5
Remove NET runtime issues section from README
GCRA101 Jul 20, 2026
aa39f41
Remove check on Environment version > 4 + RecordError in Adapter file
GCRA101 Jul 20, 2026
c264b43
Add missing call to SetUniqueName in RigidLink.cs
GCRA101 Jul 21, 2026
6ef3764
Add RefreshView at end of objs creation
GCRA101 Jul 21, 2026
cdf7a03
Implement GetBhomNameFromSAP2000Id Method
GCRA101 Jul 21, 2026
b7fdf88
Create ForceRefresh() Method
GCRA101 Jul 21, 2026
98e9800
Add Update Method for Panel objects
GCRA101 Jul 21, 2026
76ae695
Add obj.Name equality check for proper UniqueName assignment
GCRA101 Jul 21, 2026
bfa65fd
Add GetStepAndMode Method in Result.cs
GCRA101 Jul 21, 2026
7d623f7
Add Generic Method CheckAndGetIds<T> in Result.cs
GCRA101 Jul 21, 2026
28148e5
Move CheckGetBarIds method into BarResults.cs
GCRA101 Jul 21, 2026
e04b9ec
Create Read Methods for Node Vels and Accs
GCRA101 Jul 21, 2026
9a6ec0b
Remove NET runtime issues section from README (#344)
peterjamesnugent Jul 21, 2026
0071005
Remove Net runtimes error message in Adapter (#347)
peterjamesnugent Jul 21, 2026
282980a
Turn If statement into ternary operator in _ICreate.cs
GCRA101 Jul 22, 2026
a5ec8dc
Return "" instead of null obj as output of SetUniqueName in _ICreate.cs
GCRA101 Jul 22, 2026
925ed54
Add Support for Editing Obj Names (#349)
peterjamesnugent Jul 27, 2026
d93025b
Add Utility Methods for Panels conversion from SAP to BHoM
GCRA101 Jul 29, 2026
51fcb30
Create Read Method for Mesh Objects
GCRA101 Jul 29, 2026
0e6aab4
Update Adapter csproj with Read Mesh.cs
GCRA101 Jul 29, 2026
dfc98da
Add ReadMesh Method in _IRead.cs
GCRA101 Jul 29, 2026
f625bd1
Upgrade to SDK style format
peterjamesnugent Jul 29, 2026
6679c11
Removed MeshResults and GlobalResults file as they were not included …
peterjamesnugent Jul 29, 2026
83a16ba
Add explanatory comment into GetStepAndMode() utility method
GCRA101 Jul 30, 2026
7449acf
Refactor CheckAndGetIds to work with IResultRequest input
GCRA101 Jul 30, 2026
4dbb6b4
Implement refactored generic CheckAndGetIds in Read/Results
GCRA101 Jul 30, 2026
eb31b60
Remove unused panelList from ReadMesh method
GCRA101 Jul 30, 2026
4268380
Replace variable name "etabsid" with "sap2000id"
GCRA101 Jul 30, 2026
4e54455
Replace IsSAPVertical() method with Query.IsParallel()
GCRA101 Jul 30, 2026
c0cb2c9
Add Warning on single normal vector for all faces of a mesh
GCRA101 Jul 30, 2026
6d766d8
Rename PanelLocalAxisToBHoM method to ToPanelLocalXAxis
GCRA101 Jul 30, 2026
5afb102
Add missing copyright header to Read/Mesh.cs file
GCRA101 Jul 31, 2026
0f502f5
User BH Convert.FromDegree for angle values conversion
GCRA101 Jul 31, 2026
f35d879
Update project compliance
BHoMBot Aug 3, 2026
bf2795e
Remove redundant ref to BH.Engine.Units in Panel.cs
GCRA101 Aug 3, 2026
fad69cf
Update dependencies.txt
peterjamesnugent Aug 4, 2026
60c04dd
Allow Pull of FE Mesh Objects (#353)
peterjamesnugent Aug 4, 2026
eda5789
Formatting
peterjamesnugent Aug 14, 2026
2e0638e
Add Support for Joint Velocities and Accelerations (#351)
peterjamesnugent Aug 18, 2026
940d4bb
Merge branch 'develop' into SAP2000_Toolkit-#354-UpgradeProjectFilest…
peterjamesnugent Aug 21, 2026
51d1ba2
Add missing reference for units engine
peterjamesnugent Aug 21, 2026
cf1ff83
Fix project compliance failure
peterjamesnugent Aug 21, 2026
1721c52
Upgrade project files to SDK-style format compatible with dotnet (#355)
peterjamesnugent Aug 21, 2026
47baa0b
Add GetStepAndMode Method in Result.cs
GCRA101 Jul 28, 2026
d6346c1
Add method to read Mesh Forces
GCRA101 Aug 19, 2026
30e89ff
Add method to read Mesh Stresses
GCRA101 Aug 19, 2026
1039e4f
Add method to read Mesh Von Mises Stresses
GCRA101 Aug 19, 2026
e33504c
Add method to read Mesh Displacements
GCRA101 Aug 19, 2026
9934da1
Replace CheckGetPanelIds with generic CheckAndGetIds Method
GCRA101 Aug 19, 2026
9542f9b
Add support for FEMeshes in CheckAndGetIds Generic Method
GCRA101 Aug 24, 2026
010362b
Exit generic CheckAndGetIds if ids are not null
GCRA101 Aug 24, 2026
0d5f6c8
expand reference to resolve conflict
Chrisshort92 Sep 6, 2026
14e20d3
expand reference to resolve conflict (#360)
Chrisshort92 Sep 7, 2026
40f48b3
Update Warning Message in Read/Results/MeshResults.cs
GCRA101 Sep 8, 2026
3504ee9
Update Warning in Read/Results/MeshResults.cs
GCRA101 Sep 8, 2026
608c0ad
Update Error Message in Read/Results/MeshResults.cs
GCRA101 Sep 8, 2026
ef2f1b8
Update Warning in Read/Results/MeshResults.cs
GCRA101 Sep 8, 2026
33fba13
Update Warning in Read/Results/MeshResults.cs
GCRA101 Sep 8, 2026
d8885d2
Update Warning in Read/Results/MeshResults.cs
GCRA101 Sep 8, 2026
5172851
Update Warning in Read/Results/MeshResults.cs
GCRA101 Sep 8, 2026
c799e13
Update Warning in Read/Results/MeshResults.cs
GCRA101 Sep 8, 2026
19f60e8
Replace switch-case with if statement in Read/Results/MeshResults.cs
GCRA101 Sep 8, 2026
05c7f15
Merge branch 'develop' into SAP2000_Toolkit-#330-AllowPullOfMeshResults
peterjamesnugent Sep 9, 2026
e1a5143
Update Warning in /Read/Results/MeshResults.cs
GCRA101 Sep 9, 2026
80dd6ce
Update Warning in /Read/Results/MeshResults.cs
GCRA101 Sep 9, 2026
f80b3a0
Update Warning in /Read/Results/MeshResults.cs
GCRA101 Sep 9, 2026
73589d3
Update SAP2000_Adapter/CRUD/Read/Results/MeshResults.cs
GCRA101 Sep 9, 2026
058bfe6
Update SAP2000_Adapter/CRUD/Read/Results/MeshResults.cs
GCRA101 Sep 9, 2026
9386c97
Allow Pull of FE Mesh Results (#358)
peterjamesnugent Sep 11, 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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*.exe
*.o
*.so
*.dll

# Packages #
############
Expand Down
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ This toolkit allows interoperability between the BHoM and SAP2000. Enables creat
### Known Versions of Software Supported
The adapter is intended to support SAP2000 version 21 and all future versions. It is currently tested on version 23 exclusively.

### Net runtime issues

There are currently some internal failures in the SAP2000 API when called in a NET Core environment. For this reason, running the ETABSAdapter in runtimes above NET4 is disabled.

If you are using the SAP2000 Adapter with Grasshopper in Rhino 8 you can change the runtime used by Rhino to framework. To do this, please see this link: https://www.rhino3d.com/en/docs/guides/netcore/#to-change-rhino-to-always-use-net-framework

A fix to allow for higher net runtimes is being worked on.

### Documentation
For more information about functionality see [Object Relation Table](https://github.com/BHoM/SAP2000_Toolkit/wiki/BHoM-SAP2000-Object-Relations)

Expand Down
14 changes: 7 additions & 7 deletions SAP2000_Adapter/CRUD/Create/Bar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,20 @@ private bool CreateObject(Bar bhBar)
return false;
}

// Set AdapterID
if (name != bhBar.Name & bhBar.Name != "")
Engine.Base.Compute.RecordNote($"Bar {bhBar.Name} was assigned SAP2000_id of {name}");
// Assign the Unique Name to the SAP2000 Element
string newName = SetUniqueName(bhBar, name);

if (newName == null) return false;

string guid = null;
m_model.FrameObj.GetGUID(name, ref guid);
m_model.FrameObj.GetGUID(newName, ref guid);

SAP2000Id sap2000IdFragment = new SAP2000Id { Id = name, PersistentId = guid };
SAP2000Id sap2000IdFragment = new SAP2000Id { Id = newName, PersistentId = guid };
bhBar.SetAdapterId(sap2000IdFragment);

// Set Properties
SetObject(bhBar);
return SetObject(bhBar);

return true;
}

/***************************************************/
Expand Down
16 changes: 8 additions & 8 deletions SAP2000_Adapter/CRUD/Create/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ private bool CreateObject(Node bhNode)
return false;
}

// Set Adapter ID
if (name != bhNode.Name & bhNode.Name != "")
Engine.Base.Compute.RecordNote($"Node {bhNode.Name} was assigned SAP2000_id of {name}");
// Assign the Unique Name to the SAP2000 Element
string newName = SetUniqueName(bhNode, name);

if (newName == null) return false;

// Set Adapter ID
string guid = null;
m_model.PointObj.GetGUID(name, ref guid);
m_model.PointObj.GetGUID(newName, ref guid);

SAP2000Id sap2000IdFragment = new SAP2000Id { Id = name, PersistentId = guid };
SAP2000Id sap2000IdFragment = new SAP2000Id { Id = newName, PersistentId = guid };
bhNode.SetAdapterId(sap2000IdFragment);

// Set Properties
SetObject(bhNode);

return true;
return SetObject(bhNode);
}

/***************************************************/
Expand Down
15 changes: 8 additions & 7 deletions SAP2000_Adapter/CRUD/Create/Panel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,18 @@ private bool CreateObject(Panel bhPanel)
return false;
}

// Set AdapterID
if (name != bhPanel.Name & bhPanel.Name != "")
Engine.Base.Compute.RecordNote($"Panel {bhPanel.Name} was assigned SAP2000_id of {name}.");
// Assign the Unique Name to the SAP2000 Element
string newName = SetUniqueName(bhPanel, name);

if (newName == null) return false;

// Set AdapterID
string guid = null;
m_model.AreaObj.GetGUID(name, ref guid);
SAP2000Id sap2000IdFragment = new SAP2000Id{Id = name, PersistentId = guid};
m_model.AreaObj.GetGUID(newName, ref guid);
SAP2000Id sap2000IdFragment = new SAP2000Id{Id = newName, PersistentId = guid};
bhPanel.SetAdapterId(sap2000IdFragment);
// Set Properties
SetObject(bhPanel);
return true;
return SetObject(bhPanel);
}

/***************************************************/
Expand Down
49 changes: 48 additions & 1 deletion SAP2000_Adapter/CRUD/Create/RigidLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using BH.oM.Adapters.SAP2000;
using BH.oM.Structure.Elements;
using System.Collections.Generic;
using System.ComponentModel;

namespace BH.Adapter.SAP2000
{
Expand Down Expand Up @@ -86,13 +87,59 @@ private bool CreateObject(RigidLink bhLink)
}
}

sap2000id.Id = linkIds;
// Assign the Unique Name to the SAP2000 Element
List<string> newLinkNames = SetUniqueName(bhLink, linkIds);

if (newLinkNames == null) return false;

sap2000id.Id = newLinkNames;
bhLink.SetAdapterId(sap2000id);

return true;
}

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

[Description("Concatenates the last 7 characters of the SAP2000 Element GUID and the Link Name to get the Unique Name to assign to the SAP2000 Element.")]
private List<string> SetUniqueName(RigidLink bhLink, List<string> names)
{

int ret01, ret02;
string guid = null;
string tempLinkName = "";
List<string> newLinkNames = new List<string>();

foreach (string name in names)
{

/* 1. GET THE SAP2000 ELEMENT GUID */
tempLinkName = "";
ret01 = m_model.LinkObj.GetGUID(name, ref guid);

/* 2. CREATE THE NEW UNIQUE NAME */
if (bhLink.Name == "")
{
tempLinkName = guid.Substring(guid.Length - 7);
}
else
{
tempLinkName = bhLink.Name + "::" + guid.Substring(guid.Length - 7);
}

/* 3. ASSIGN THE NEW UNIQUE NAME TO THE SAP2000 ELEMENT */
ret02 = m_model.LinkObj.ChangeName(name, tempLinkName);

/* 4. ADD THE NEW NAME TO THE LIST */
newLinkNames.Add(tempLinkName);

if (!(ret01 == 0 && ret02 == 0)) return null;

}

return newLinkNames;
}

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

Expand Down
60 changes: 53 additions & 7 deletions SAP2000_Adapter/CRUD/Create/_ICreate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,22 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using BH.oM.Adapter;
using BH.oM.Adapters.SAP2000;
using BH.oM.Analytical;
using BH.oM.Base;
using BH.oM.Dimensional;
using BH.oM.Structure.Constraints;
using BH.oM.Structure.Elements;
using BH.oM.Structure.Loads;
using BH.oM.Structure.Constraints;
using BH.oM.Structure.MaterialFragments;
using BH.oM.Structure.SectionProperties;
using BH.oM.Structure.SurfaceProperties;
using BH.oM.Structure.MaterialFragments;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using BH.oM.Analytical;
using BH.oM.Adapter;
using BH.oM.Adapters.SAP2000;

namespace BH.Adapter.SAP2000
{
Expand All @@ -46,16 +47,26 @@ public partial class SAP2000Adapter

protected override bool ICreate<T>(IEnumerable<T> objects, ActionConfig actionConfig)
{
bool success = true;

this.SAPPushConfig = actionConfig as SAP2000PushConfig;

if (!objects.Any()) //Return if no objects
return true;

if (typeof(BH.oM.Base.IBHoMObject).IsAssignableFrom(typeof(T)))
{
return (CreateCollection(objects));
success = CreateCollection(objects);
}
else
{
return false;
success = false;
}

// Refresh the view to ensure that the newly created objects are displayed correctly
m_model.View.RefreshView(0, false);

return success;
}

/***************************************************/
Expand All @@ -82,6 +93,41 @@ private bool CreateObject(IBHoMObject obj)
}

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

[Description("Concatenates the the BHoM Object Name and the last 7 characters of the SAP2000 Element GUID to get the Unique Name to assign to the SAP2000 Element.")]
private string SetUniqueName(BHoMObject obj, string name)
{
/* 1. CHECK OBJECT TYPE IS ACCEPTABLE */
if (!(obj.GetType() == typeof(Node) ||
obj.GetType() == typeof(Bar) ||
obj.GetType() == typeof(Panel) ||
obj.GetType() == typeof(Opening)))
{
return null;
}

/* 2. GET THE SAP2000 ELEMENT GUID */
int ret01 = 1;
int ret02 = 1;
string guid = null;

if (obj.GetType() == typeof(Node)) ret01 = m_model.PointObj.GetGUID(name, ref guid);
if (obj.GetType() == typeof(Bar)) ret01 = m_model.FrameObj.GetGUID(name, ref guid);
if (obj.GetType() == typeof(Panel) || obj.GetType() == typeof(Opening)) ret01 = m_model.AreaObj.GetGUID(name, ref guid);

string tempObjName = obj.Name == "" ? guid.Substring(guid.Length - 7) : obj.Name + "::" + guid.Substring(guid.Length - 7);

/* 4. ASSIGN THE NEW UNIQUE NAME TO THE SAP2000 ELEMENT */
if (obj.GetType() == typeof(Node)) ret02 = m_model.PointObj.ChangeName(name, tempObjName);
if (obj.GetType() == typeof(Bar)) ret02 = m_model.FrameObj.ChangeName(name, tempObjName);
if (obj.GetType() == typeof(Panel) || obj.GetType() == typeof(Opening)) ret02 = m_model.AreaObj.ChangeName(name, tempObjName);

if (!(ret01 == 0 && ret02 == 0)) return "";

return tempObjName;

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

Expand Down
6 changes: 5 additions & 1 deletion SAP2000_Adapter/CRUD/Read/Bar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ private List<Bar> ReadBars(List<string> ids = null)

try
{
Bar bhomBar = new Bar();

string bhomName = GetBhomNameFromSAP2000Id(id);

Bar bhomBar = new Bar() { Name = bhomName };

string startId = "";
string endId = "";
m_model.FrameObj.GetPoints(id, ref startId, ref endId);
Expand Down
Loading