Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.3 Deployment #470

Merged
merged 18 commits into from
Sep 19, 2024
Merged
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
2 changes: 1 addition & 1 deletion ETABS_Engine/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.0.0.0")]
[assembly: AssemblyFileVersion("7.2.0.0")]
[assembly: AssemblyFileVersion("7.3.0.0")]



Expand Down
17 changes: 11 additions & 6 deletions ETABS_oM/ETABS_oM.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -33,22 +33,27 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="BHoM">
<HintPath>C:\ProgramData\BHoM\Assemblies\BHoM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\BHoM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Data_oM">
<HintPath>C:\ProgramData\BHoM\Assemblies\Data_oM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Data_oM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Geometry_oM">
<HintPath>C:\ProgramData\BHoM\Assemblies\Geometry_oM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Geometry_oM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Quantities_oM">
<HintPath>$(ProgramData)\BHoM\Assemblies\Quantities_oM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Structure_oM">
<HintPath>C:\ProgramData\BHoM\Assemblies\Structure_oM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Structure_oM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
Expand Down Expand Up @@ -99,4 +104,4 @@ xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
2 changes: 1 addition & 1 deletion ETABS_oM/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.0.0.0")]
[assembly: AssemblyFileVersion("7.2.0.0")]
[assembly: AssemblyFileVersion("7.3.0.0")]



Expand Down
37 changes: 35 additions & 2 deletions ETABS_oM/Results/PierForce.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BH.oM.Structure.Results;
using BH.oM.Base;
using BH.oM.Quantities.Attributes;
using System.ComponentModel;

namespace BH.oM.Adapters.ETABS.Results
{
public class PierForce : Structure.Results.BarForce, IImmutable
public class PierForce : BarResult, IImmutable
{
/***************************************************/
/**** Public Properties ****/
Expand All @@ -39,14 +42,44 @@ public class PierForce : Structure.Results.BarForce, IImmutable
//Just using this for the name
public virtual string Location { get; } = "";

[Force]
[Description("Axial force along the local x-axis. Positive for tension, negative for compression.")]
public virtual double FX { get; }

[Force]
[Description("Shear force along the local y-axis. Generally minor axis shear force.")]
public virtual double FY { get; }

[Force]
[Description("Shear force along the local z-axis. Generally major axis shear force.")]
public virtual double FZ { get; }

[Moment]
[Description("Torsional moment.")]
public virtual double MX { get; }

[Moment]
[Description("Bending moment about the local y-axis. Generally major axis bending moment.")]
public virtual double MY { get; }

[Moment]
[Description("Bending moment about the local z-axis. Generally minor axis bending moment.")]
public virtual double MZ { get; }

/***************************************************/
/**** Constructors ****/
/***************************************************/

public PierForce(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)
: base(objectId, resultCase, modeNumber, timeStep, position, divisions, fx, fy, fz, mx, my, mz)
: base(objectId, resultCase, modeNumber, timeStep, position, divisions)
{
Location = location;
FX = fx;
FY = fy;
FZ = fz;
MX = mx;
MY = my;
MZ = mz;
}

/***************************************************/
Expand Down
16 changes: 16 additions & 0 deletions Etabs_Adapter/CRUD/Create/Load.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,22 @@ public void SetLoad(GravityLoad gravityLoad, bool replace)
BH.Engine.Base.Compute.RecordWarning("ETABS handles gravity loads via loadcases, why only one gravity load per loadcase can be used. THis gravity load will be applied to all objects");
}

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

public void SetLoad(PointDisplacement pointDisplacementLoad, bool replace)
{
double[] pdValues = new double[] { pointDisplacementLoad.Translation.X, pointDisplacementLoad.Translation.Y, pointDisplacementLoad.Translation.Z,
pointDisplacementLoad.Rotation.X, pointDisplacementLoad.Rotation.Y, pointDisplacementLoad.Rotation.Z};
int ret = 0;

foreach (Node node in pointDisplacementLoad.Objects.Elements)
{
string caseName = GetAdapterId<string>(pointDisplacementLoad.Loadcase);
string nodeName = GetAdapterId<string>(node);
ret = m_model.PointObj.SetLoadDispl(nodeName, caseName, ref pdValues, replace);
}
}


/***************************************************/
/**** Helper Methods ****/
Expand Down
55 changes: 55 additions & 0 deletions Etabs_Adapter/CRUD/Read/Load.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ private List<ILoad> ReadLoad(Type type, List<string> ids = null)
typeCouldBeRead = true;
}

if (type.IsAssignableFrom(typeof(PointDisplacement)))
{
loads.AddRange(ReadPointDisplacementLoad(loadcaseList));
typeCouldBeRead = true;
}

if (type.IsAssignableFrom(typeof(BarUniformlyDistributedLoad)))
{
loads.AddRange(ReadBarLoad(loadcaseList));
Expand Down Expand Up @@ -176,6 +182,55 @@ private List<ILoad> ReadPointLoad(List<Loadcase> loadcases)

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

private List<ILoad> ReadPointDisplacementLoad(List<Loadcase> loadcases)
{
List<ILoad> bhDisplLoads = new List<ILoad>();

Dictionary<string, Node> bhomNodes = GetCachedOrReadAsDictionary<string, Node>();

string[] names = null;
string[] loadcase = null;
string[] CSys = null;
int[] step = null;
int nameCount = 0;
double[] u1 = null;
double[] u2 = null;
double[] u3 = null;
double[] r1 = null;
double[] r2 = null;
double[] r3 = null;

if (m_model.PointObj.GetLoadDispl("All", ref nameCount, ref names, ref loadcase, ref step, ref CSys, ref u1, ref u2, ref u3, ref r1, ref r2, ref r3, eItemType.Group) != 0)
return bhDisplLoads;

for (int i = 0; i < nameCount; i++)
{
if (CSys[i] != "Global")
Engine.Base.Compute.RecordWarning($"The coordinate system: {CSys[i]} was not read. The PointLoads defined in the coordinate system: {CSys[i]} were set as Global");

Loadcase bhLoadcase = loadcases.FirstOrDefault(x => x.Name == loadcase[i]);

if (bhLoadcase == null)
continue;

PointDisplacement bhDisplLoad = new PointDisplacement()
{
Translation = new Vector() { X = u1[i], Y = u2[i], Z = u3[i] },
Rotation = new Vector() { X = r1[i], Y = r2[i], Z = r3[i] },
Loadcase = bhLoadcase,
Objects = new BHoMGroup<Node>() { Elements = { bhomNodes[names[i]] } }
};

bhDisplLoads.Add(bhDisplLoad);
}

return bhDisplLoads;

}

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


private List<ILoad> ReadBarLoad(List<Loadcase> loadcases)
{
List<ILoad> bhLoads = new List<ILoad>();
Expand Down
75 changes: 71 additions & 4 deletions Etabs_Adapter/CRUD/Read/Results/NodeResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
using BH.oM.Structure.Requests;
using BH.oM.Adapter;
using BH.oM.Structure.Elements;
using System.Xml.Linq;

namespace BH.Adapter.ETABS
{
Expand Down Expand Up @@ -67,7 +68,9 @@ public IEnumerable<IResult> ReadResults(NodeResultRequest request, ActionConfig
case NodeResultType.NodeDisplacement:
return ReadNodeDisplacement(nodeIds);
case NodeResultType.NodeVelocity:
return ReadNodeVelocity(nodeIds);
case NodeResultType.NodeAcceleration:
return ReadNodeAcceleration(nodeIds);
default:
Engine.Base.Compute.RecordError("Result extraction of type " + request.ResultType + " is not yet supported");
return new List<IResult>();
Expand All @@ -78,9 +81,42 @@ public IEnumerable<IResult> ReadResults(NodeResultRequest request, ActionConfig
/**** Private method - Extraction methods ****/
/***************************************************/

private List<NodeResult> ReadNodeAcceleration(IList ids = null, IList cases = null)
private List<NodeAcceleration> ReadNodeAcceleration(List<string> nodeIds)
{
throw new NotImplementedException("Node Acceleration results is not supported yet!");

List<NodeAcceleration> nodeAccelerations = new List<NodeAcceleration>();

int resultCount = 0;
string[] loadcaseNames = null;
string[] objects = null;
string[] elm = null;
string[] stepType = null;
double[] stepNum = null;
double[] ux = null;
double[] uy = null;
double[] uz = null;
double[] rx = null;
double[] ry = null;
double[] rz = null;

for (int i = 0; i < nodeIds.Count; i++)
{
int ret = m_model.Results.JointAccAbs(nodeIds[i].ToString(), eItemTypeElm.ObjectElm, ref resultCount, ref objects, ref elm, ref loadcaseNames,
ref stepType, ref stepNum, ref ux, ref uy, ref uz, ref rx, ref ry, ref rz);
if (ret == 0)
{
for (int j = 0; j < resultCount; j++)
{
int mode;
double timeStep;
GetStepAndMode(stepType[j], stepNum[j], out timeStep, out mode);
NodeAcceleration na = new NodeAcceleration(nodeIds[i], loadcaseNames[j], mode, timeStep, oM.Geometry.Basis.XY, ux[j], uy[j], uz[j], rx[j], ry[j], rz[j]);
nodeAccelerations.Add(na);
}
}
}

return nodeAccelerations;
}

/***************************************************/
Expand Down Expand Up @@ -166,10 +202,41 @@ private List<NodeReaction> ReadNodeReaction(List<string> nodeIds)

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

private List<NodeResult> ReadNodeVelocity(IList ids = null, IList cases = null)
private List<NodeVelocity> ReadNodeVelocity(List<string> nodeIds)
{
throw new NotImplementedException("Node Acceleration results is not supported yet!");
List<NodeVelocity> nodeVelocities = new List<NodeVelocity>();

int resultCount = 0;
string[] loadcaseNames = null;
string[] objects = null;
string[] elm = null;
string[] stepType = null;
double[] stepNum = null;
double[] ux = null;
double[] uy = null;
double[] uz = null;
double[] rx = null;
double[] ry = null;
double[] rz = null;

for (int i = 0; i < nodeIds.Count; i++)
{
int ret = m_model.Results.JointVelAbs(nodeIds[i], eItemTypeElm.ObjectElm, ref resultCount, ref objects, ref elm,
ref loadcaseNames, ref stepType, ref stepNum, ref ux, ref uy, ref uz, ref rx, ref ry, ref rz);
if (ret == 0)
{
for (int j = 0; j < resultCount; j++)
{
int mode;
double timeStep;
GetStepAndMode(stepType[j], stepNum[j], out timeStep, out mode);
NodeVelocity nv = new NodeVelocity(nodeIds[i], loadcaseNames[j], mode, timeStep, oM.Geometry.Basis.XY, ux[j], uy[j], uz[j], rx[j], ry[j], rz[j]);
nodeVelocities.Add(nv);
}
}
}

return nodeVelocities;
}

/***************************************************/
Expand Down
4 changes: 2 additions & 2 deletions Etabs_Adapter/Etabs_Adapter.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -427,4 +427,4 @@ xcopy "$(TargetDir)CSiAPIv1.dll" "C:\ProgramData\BHoM\Assemblies" /Y
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
2 changes: 1 addition & 1 deletion Etabs_Adapter/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.0.0.0")]
[assembly: AssemblyFileVersion("7.2.0.0")]
[assembly: AssemblyFileVersion("7.3.0.0")]



Expand Down