Skip to content

Commit edc11e0

Browse files
Add Spandrel Force Result (#457)
2 parents 1400bce + 4903342 commit edc11e0

File tree

6 files changed

+145
-5
lines changed

6 files changed

+145
-5
lines changed

ETABS_oM/ETABS_oM.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
<Compile Include="Fragments\ShellTypeFragment.cs" />
7272
<Compile Include="Requests\Enum\PierAndSpandrelResultType.cs" />
7373
<Compile Include="Requests\PierAndSpandrelForceRequest.cs" />
74+
<Compile Include="Results\SpandrelForce.cs" />
7475
<Compile Include="Settings\DataBaseSettings.cs" />
7576
<Compile Include="Settings\EtabsSettings.cs" />
7677
<Compile Include="Enums\SectionDatabase.cs" />

ETABS_oM/Requests/Enum/PierAndSpandrelResultType.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ namespace BH.oM.Adapters.ETABS.Requests
2727
[Description("Defines the type of results that should be extracted for PierAndSpandrelForceRequest.")]
2828
public enum PierAndSpandrelResultType
2929
{
30-
PierForce
30+
PierForce,
31+
SpandrelForce
3132
}
3233
}
3334

ETABS_oM/Results/SpandrelForce.cs

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
* This file is part of the Buildings and Habitats object Model (BHoM)
3+
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
4+
*
5+
* Each contributor holds copyright over their respective contributions.
6+
* The project versioning (Git) records all such contribution source information.
7+
*
8+
*
9+
* The BHoM is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Lesser General Public License as published by
11+
* the Free Software Foundation, either version 3.0 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* The BHoM is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU Lesser General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Lesser General Public License
20+
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
21+
*/
22+
23+
24+
25+
using System;
26+
using System.Collections.Generic;
27+
using System.Linq;
28+
using System.Text;
29+
using System.Threading.Tasks;
30+
using BH.oM.Structure.Results;
31+
using BH.oM.Base;
32+
using BH.oM.Quantities.Attributes;
33+
using System.ComponentModel;
34+
35+
36+
namespace BH.oM.Adapters.ETABS.Results
37+
{
38+
public class SpandrelForce : BarResult, IImmutable
39+
{
40+
/***************************************************/
41+
/**** Public Properties ****/
42+
/***************************************************/
43+
44+
//Just using this for the name
45+
public virtual string Location { get; } = "";
46+
[Force]
47+
[Description("Axial force along the local x-axis. Positive for tension, negative for compression.")]
48+
public virtual double FX { get; }
49+
50+
[Force]
51+
[Description("Shear force along the local y-axis. Generally minor axis shear force.")]
52+
public virtual double FY { get; }
53+
54+
[Force]
55+
[Description("Shear force along the local z-axis. Generally major axis shear force.")]
56+
public virtual double FZ { get; }
57+
58+
[Moment]
59+
[Description("Torsional moment.")]
60+
public virtual double MX { get; }
61+
62+
[Moment]
63+
[Description("Bending moment about the local y-axis. Generally major axis bending moment.")]
64+
public virtual double MY { get; }
65+
66+
[Moment]
67+
[Description("Bending moment about the local z-axis. Generally minor axis bending moment.")]
68+
public virtual double MZ { get; }
69+
/***************************************************/
70+
/**** Constructors ****/
71+
/***************************************************/
72+
73+
public SpandrelForce(IComparable objectId, IComparable resultCase, string location, int modeNumber, double timeStep, double position, int divisions, double fx, double fy, double fz, double mx, double my, double mz)
74+
: base(objectId, resultCase, modeNumber, timeStep, position, divisions)
75+
{
76+
Location = location;
77+
FX = fx;
78+
FY = fy;
79+
FZ = fz;
80+
MX = mx;
81+
MY = my;
82+
MZ = mz;
83+
}
84+
85+
/***************************************************/
86+
}
87+
}
88+
89+
90+
91+
92+

Etabs_Adapter/CRUD/Read/Results/PierAndSpandrelResults.cs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public IEnumerable<IResult> ReadResults(PierAndSpandrelForceRequest request, Act
5757
{
5858
case PierAndSpandrelResultType.PierForce:
5959
return GetPierForce(request.ObjectIds);
60+
case PierAndSpandrelResultType.SpandrelForce:
61+
return GetSpandrelForce(request.ObjectIds);
6062
default:
6163
Engine.Base.Compute.RecordError("Result extraction of type " + request.ResultType + " is not yet supported");
6264
return new List<IResult>();
@@ -67,6 +69,7 @@ public IEnumerable<IResult> ReadResults(PierAndSpandrelForceRequest request, Act
6769
/**** Private method - Extraction methods ****/
6870
/***************************************************/
6971

72+
/* Pier Forces */
7073
private List<PierForce> GetPierForce(IList ids = null)
7174
{
7275
List<PierForce> pierForces = new List<PierForce>();
@@ -105,6 +108,48 @@ private List<PierForce> GetPierForce(IList ids = null)
105108
}
106109

107110

111+
/* Spandrel Forces */
112+
private List<SpandrelForce> GetSpandrelForce(IList ids = null)
113+
{
114+
List<SpandrelForce> spandrelForces = new List<SpandrelForce>();
115+
116+
string[] loadcaseNames = null;
117+
118+
int numberResults = 0;
119+
string[] storyName = null;
120+
string[] spandrelName = null;
121+
string[] location = null;
122+
123+
double[] p = null;
124+
double[] v2 = null;
125+
double[] v3 = null;
126+
double[] t = null;
127+
double[] m2 = null;
128+
double[] m3 = null;
129+
130+
int ret = m_model.Results.SpandrelForce(ref numberResults, ref storyName, ref spandrelName, ref loadcaseNames, ref location, ref p, ref v2, ref v3, ref t, ref m2, ref m3);
131+
if (ret == 0)
132+
{
133+
for (int j = 0; j < numberResults; j++)
134+
{
135+
int position = 0;
136+
if (location[j].ToUpper().Contains("RIGHT"))
137+
{
138+
position = 1;
139+
}
140+
141+
SpandrelForce sf = new SpandrelForce(spandrelName[j],loadcaseNames[j], storyName[j], 0, 0, position, 2, p[j], v2[j], v3[j], t[j], m2[j], m3[j]);
142+
143+
spandrelForces.Add(sf);
144+
}
145+
146+
}
147+
return spandrelForces;
148+
149+
}
150+
151+
152+
108153
/***************************************************/
109154

110155
}

Etabs_Adapter/Etabs_Adapter.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,4 +427,4 @@ xcopy "$(TargetDir)CSiAPIv1.dll" "C:\ProgramData\BHoM\Assemblies" /Y
427427
<Target Name="AfterBuild">
428428
</Target>
429429
-->
430-
</Project>
430+
</Project>

Etabs_Adapter/Types/DependencyTypes.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
using BH.Engine.Adapter;
3131
using BH.oM.Adapters.ETABS;
3232
using System.Collections.Generic;
33+
using BH.oM.Spatial.SettingOut;
3334

3435
namespace BH.Adapter.ETABS
3536
{
@@ -49,11 +50,11 @@ protected void SetupDependencies()
4950
{
5051
DependencyTypes = new Dictionary<Type, List<Type>>
5152
{
52-
{typeof(Bar), new List<Type> { typeof(ISectionProperty), typeof(Node) } },
53+
{typeof(Bar), new List<Type> { typeof(ISectionProperty), typeof(Node)} },
5354
{typeof(ISectionProperty), new List<Type> { typeof(IMaterialFragment) } },
54-
{typeof(Panel), new List<Type> { typeof(ISurfaceProperty) } },
55+
{typeof(Panel), new List<Type> { typeof(ISurfaceProperty)} },
5556
{typeof(ISurfaceProperty), new List<Type> { typeof(IMaterialFragment) } },
56-
{typeof(RigidLink), new List<Type> { typeof(Node), typeof(LinkConstraint) } },
57+
{typeof(RigidLink), new List<Type> { typeof(Node), typeof(LinkConstraint)} },
5758
{typeof(ILoad), new List<Type> {typeof(Loadcase) } },
5859
{typeof(IElementLoad<Bar>), new List<Type>{ typeof(Bar)} },
5960
{typeof(IElementLoad<Node>), new List<Type>{ typeof(Node)} }

0 commit comments

Comments
 (0)