removed Revit 2021 SDK contents

This commit is contained in:
Jeremy Tammik
2021-04-20 11:25:53 +02:00
parent 68771b6636
commit 1133a82dc5
2969 changed files with 0 additions and 940446 deletions
@@ -1,280 +0,0 @@
//
// (C) Copyright 2003-2013 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
using System;
using System.Linq;
namespace CodeCheckingConcreteExample.Concrete
{
static class CalculationUtility
{
/// <summary>
/// The smallest positive value of force treated as non-zero value.
/// </summary>
private const double toleranceForN = 1.0;
/// <summary>
/// The smallest positive value of moment treated as non-zero value.
/// </summary>
private const double toleranceForM = 1.0;
/// <summary>
/// The smallest positive value of reinforcement treated as non-zero value.
/// </summary>
private const double toleranceForAs = 1.0e-7;
/// <summary>
/// The tolerance for safety factor. The final coefficient should not deviate from the values 1.0 of more than toleranceForSafetyFactor
/// </summary>
private const double toleranceForSafetyFactor = 0.005;
/// <structural_toolkit_2015>
/// <summary>
/// The smallest value of reinforcement for the iterative loops.
/// </summary>
private const double minimumAsIncrease = 10.0 * toleranceForAs;
/// <structural_toolkit_2015>
/// <summary>
/// The lowest acceptable safety factor in the iterative loops.
/// </summary>
private const double minSafetyFactor = 1.0 - toleranceForSafetyFactor;
/// <summary>
/// The biggest acceptable safety factor in the iterative loops.
/// </summary>
private const double maxSafetyFactor = 1.0 + toleranceForSafetyFactor;
/// <summary>
/// The maximum of steps in the iterative loops.
/// </summary>
private const int maximumIterationStep = 100;
/// <summary>
/// Checks with internal accuracy if reinforcement area equals zero
/// </summary>
/// <param name="totalSteelArea">Tested reinforcement area</param>
/// <returns>True if reinforcement is below margin</returns>
static public bool IsZeroReinforcement(double totalSteelArea)
{
if (totalSteelArea > toleranceForAs)
return false;
else
return true;
}
/// <structural_toolkit_2015>
/// <summary>
/// Returns value of minimum increase of reinforcement in the iterative step.
/// </summary>
/// <returns>Minimal reinforcement value</returns>
static public double MinimumIncreaseOfReinforcement()
{
return minimumAsIncrease;
}
/// </structural_toolkit_2015>
/// <summary>
/// Checks with internal accuracy if force equals zero
/// </summary>
/// <param name="n">Tested force value</param>
/// <returns>True if force is below margin zero</returns>
static public bool IsZeroN(double n)
{
if (Math.Abs(n) > toleranceForN)
return false;
else
return true;
}
/// <summary>
/// Checks with internal accuracy if force is greater than zero
/// </summary>
/// <param name="n">Tested force value</param>
/// <returns>True if force is greater than zero</returns>
static public bool GtZeroN(double n)
{
if (n > Double.Epsilon)
return true;
else
return false;
}
/// <summary>
/// Checks with internal accuracy if force is less than zero
/// </summary>
/// <param name="n">Tested force value</param>
/// <returns>True if force is less than zero</returns>
static public bool LtZeroN(double n)
{
if (n < -Double.Epsilon)
return true;
else
return false;
}
/// <summary>
/// Checks with internal accuracy if moment equals zero
/// </summary>
/// <param name="m">Tested moment value</param>
/// <returns>True if moment is below margin zero</returns>
static public bool IsZeroM(double m)
{
if (Math.Abs(m) > toleranceForM)
return false;
else
return true;
}
/// <summary>
/// Checks with internal accuracy if moment is greater than zero
/// </summary>
/// <param name="m">Tested moment value</param>
/// <returns>True if moment is greater than zero</returns>
static public bool GtZeroM(double m)
{
if (m > Double.Epsilon)
return true;
else
return false;
}
/// <summary>
/// Checks with internal accuracy if moment is less than zero
/// </summary>
/// <param name="m">Tested moment value</param>
/// <returns>True if moment is less than zero</returns>
static public bool LtZeroM(double m)
{
if (m < -Double.Epsilon)
return true;
else
return false;
}
/// <summary>
/// Checks if number of iterations exceeded arbitrary maximum number of iterations
/// </summary>
/// <param name="i">Tested number of iterations</param>
/// <returns>True if number of iterations exceeded maximum</returns>
static public bool IsIterEnd(int i)
{
if (i < maximumIterationStep)
return false;
else
return true;
}
/// <summary>
/// Checks if safety factor is above arbitrary minimum
/// </summary>
/// <param name="safetyFactor">Tested safety factor value</param>
/// <returns>True if safety factor is above minimum</returns>
static public bool IsSafety(double safetyFactor)
{
return (safetyFactor >= minSafetyFactor);
}
/// <summary>
/// Checks whether safety factor is within limits of optimal level
/// </summary>
/// <param name="safetyFactor">Tested safety factor value</param>
/// <returns>True if safety factor on optimal level</returns>
static public bool IsSafetyOptimal(double safetyFactor)
{
return (safetyFactor >= minSafetyFactor) && (safetyFactor <= maxSafetyFactor);
}
/// <summary>
/// Returns the value linear function defined by two points in a given point
/// </summary>
/// <param name="x1">x coordinate of the first definition point</param>
/// <param name="y1">y coordinate of the first definition point</param>
/// <param name="x2">x coordinate of the second definition point</param>
/// <param name="y2">y coordinate of the second definition point</param>
/// <param name="x3">x coordinate for which function value is searched</param>
/// <returns>Value (y coordinate) of function</returns>
static public double ValueOfLinearFunction(double x1, double y1, double x2, double y2, double x3)
{
double y3 = float.MaxValue;
if (Math.Abs(x1 - x2) > float.MaxValue)
{
y3 = y1 + (x3 - x1) * (y2 - y1) / (x2 - x1);
}
else if (Math.Abs(y1 - y2) < float.MaxValue)
{
y3 = 0.5 * (y1 + y2);
}
return y3;
}
/// <summary>
/// Finds roots of quadratic equation
/// </summary>
/// <param name="a">equation first parameter</param>
/// <param name="b">equation second parameter</param>
/// <param name="c">equation third parameter</param>
/// <param name="x1">reference to the first root value</param>
/// <param name="x2">reference to the second root value</param>
/// <returns>false if equation has no roots</returns>
static public bool RootsOfQuadraticEquation(double a, double b, double c, ref double x1, ref double x2)
{
bool realRoots = true;
double delta = b * b - 4.0 * a * c;
if (delta < 0)
{
x1 = x2 = Double.NaN;
realRoots = false;
}
else
{
delta = Math.Sqrt(delta);
x1 = (-b + delta) / (2.0 * a);
x2 = (-b - delta) / (2.0 * a);
}
return realRoots;
}
/// <summary>
/// Function created XML format file if rcuapiNet component thrown the exception.
/// File will be created in current user TEMP path. This file will be useful to debug the rcuapiNet.
/// The rcuapiNETSerializer.dll component is necessary.
/// rcuapiNETSerializer.dll and rcuapiNET.dll should be in the same localization.
/// </summary>
/// <param name="exception">The exceprtion from rcuapiNET.dll</param>
static public void SerializeIRCException(Autodesk.CodeChecking.Concrete.IRCException exception)
{
String assemblyName = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\" + "rcuapiNETSerializer.dll";
if (System.IO.File.Exists(assemblyName))
{
System.Reflection.Assembly assembly = System.Reflection.Assembly.LoadFrom(assemblyName);
Type serializerType = assembly.GetTypes().First(s => s.FullName == "Autodesk.CodeChecking.ConcreteSerializer.Serializer");
System.Reflection.MethodInfo serializeMethod = serializerType.GetMethod("Serialize");
object serializedDoc = serializeMethod.Invoke(null, new object[] { exception });
string docTitle = System.IO.Path.GetTempPath() + "IRCException" + DateTime.Now.Ticks + "_" + System.Threading.Thread.CurrentThread.ManagedThreadId + ".rcx";
(serializedDoc as System.Xml.Linq.XDocument).Save(docTitle);
}
}
}
}
@@ -1,61 +0,0 @@
//
// (C) Copyright 2003-2013 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CodeCheckingConcreteExample.Concrete
{
/// <summary>
/// Base class for internal forces in different structural elements
/// </summary>
abstract class InternalForcesBase
{
/// <summary>
/// Creates default InternalForcesBase
/// </summary>
protected InternalForcesBase() { }
/// <summary>
/// Get or set number of the related load case
/// </summary>
int RelatedCaseId
{
get { return relatedCaseId; }
set { relatedCaseId = value; }
}
/// <summary>
/// Get or set number of the related point
/// </summary>
int RelatedPointId
{
get { return relatedPointId; }
set { relatedPointId = value; }
}
private int relatedCaseId;
private int relatedPointId;
}
}
@@ -1,101 +0,0 @@
//
// (C) Copyright 2003-2013 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.Revit.DB.CodeChecking.Engineering;
namespace CodeCheckingConcreteExample.Concrete
{
/// <summary>
/// Simple container class for all possible internal forces in section
/// </summary>
public class InternalForcesContainer
{
/// <summary>
/// Initializes a new instance of InternalForcesContainer object with default 0.0 values.
/// </summary>
public InternalForcesContainer()
{
ForceFx = 0.0; ForceFy = 0.0; ForceFz = 0.0; MomentMx = 0.0; MomentMy = 0.0; MomentMz = 0.0; DeflectionUx = 0.0; DeflectionUy = 0.0; DeflectionUz = 0.0;
LimitState = ForceLimitState.Unknown;
CaseName = "";
}
/// <summary>
/// Gets or sets the force Fx (axial force).
/// </summary>
public double ForceFx { get; set; }
/// <summary>
/// Gets or sets the force Fy.
/// </summary>
public double ForceFy { get; set; }
/// <summary>
/// Gets or sets the force Fz (main shear force).
/// </summary>
public double ForceFz { get; set; }
/// <summary>
/// Gets or sets the moment Mz (torsion moment).
/// </summary>
public double MomentMx { get; set; }
/// <summary>
/// Gets or sets the moment My (main bending moment).
/// </summary>
public double MomentMy { get; set; }
/// <summary>
/// Gets or sets the moment My (main bending moment).
/// </summary>
public double MomentMz { get; set; }
/// <summary>
/// Gets or sets deflection Ux
/// </summary>
public double DeflectionUx { get; set; }
/// <summary>
/// Gets or sets deflection Uy
/// </summary>
public double DeflectionUy { get; set; }
/// <summary>
/// Gets or sets deflection Uz
/// </summary>
public double DeflectionUz { get; set; }
/// <summary>
/// Gets or sets the limit state.
/// </summary>
public ForceLimitState LimitState { get; set; }
/// <summary>
/// Gets or sets description of combination or case.
/// </summary>
public string CaseName { get; set; }
}
}
@@ -1,49 +0,0 @@
//
// (C) Copyright 2003-2013 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.Revit.DB.CodeChecking.Engineering;
namespace CodeCheckingConcreteExample.Concrete
{
/// <summary>
/// Class for internal forces in linear elements
/// </summary>
class InternalForcesLinear : InternalForcesBase
{
/// <summary>
/// Creates default
/// </summary>
public InternalForcesLinear()
{
Forces = new InternalForcesContainer();
}
/// <summary>
/// Gets or sets forces container
/// </summary>
public InternalForcesContainer Forces { get; set; }
}
}
@@ -1,77 +0,0 @@
//
// (C) Copyright 2003-2013 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.Revit.DB.CodeChecking.Engineering;
/// <structural_toolkit_2015>
namespace CodeCheckingConcreteExample.Concrete
{
class InternalForcesSurface : InternalForcesBase
{
public InternalForcesSurface()
{
ForceFxx = 0.0; ForceFyy = 0.0; ForceFxy = 0.0;
MomentMxx = 0.0; MomentMyy = 0.0; MomentMxy = 0.0;
LimitState = ForceLimitState.Unknown;
ForceDescription = "";
}
public InternalForcesContainer Forces(ConcreteTypes.DimensioningDirection direction)
{
InternalForcesContainer forces = new InternalForcesContainer();
forces.CaseName = ForceDescription;
forces.LimitState = LimitState;
if (direction == ConcreteTypes.DimensioningDirection.X)
{
forces.ForceFx = -ForceFxx; // Due to ResultBuilder conventions of the forces sign.
forces.MomentMy = -MomentMxx; // Due to ResultBuilder conventions of the forces sign.
forces.ForceFz = ForceQxx;
}
else
{
forces.ForceFx = -ForceFyy; // Due to ResultBuilder conventions of the forces sign.
forces.MomentMy = -MomentMyy; // Due to ResultBuilder conventions of the forces sign.
forces.ForceFz = ForceQyy;
}
return forces;
}
public double ForceFxx { get; set; }
public double ForceFyy { get; set; }
public double ForceFxy { get; set; }
public double MomentMxx { get; set; }
public double MomentMyy { get; set; }
public double MomentMxy { get; set; }
public double ForceQxx { get; set; }
public double ForceQyy { get; set; }
public ForceLimitState LimitState { get; set; }
public string ForceDescription { get; set; }
}
}
/// </structural_toolkit_2015>
@@ -1,240 +0,0 @@
//
// (C) Copyright 2003-2013 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
using System.Collections.Generic;
namespace CodeCheckingConcreteExample
{
namespace ConcreteTypes // todo: move this class to a new project file
{
/// <summary>
/// Classification of available forces
/// </summary>
public enum EnabledInternalForces
{
/// <summary>
/// Axial force. The force acting along the element.
/// </summary>
FX = 0x01,
/// <summary>
/// Shear force. The force acting perpendicular to the element, along Y axia.
/// </summary>
FY = 0x02,
/// <summary>
/// Shear force. The force acting perpendicular to the element along Z axis.
/// </summary>
FZ = 0x04,
/// <summary>
/// Torsional moment.
/// </summary>
MX = 0x08,
/// <summary>
/// Bending moment. Bending around the Y axis.
/// </summary>
MY = 0x10,
/// <summary>
/// Bending moment. Bending around the Z axis.
/// </summary>
MZ = 0x20,
}
/// <structural_toolkit_2015>
/// <summary>
/// Classification of forces direction in the plain object
/// </summary>
public enum DimensioningDirection
{
/// <summary>
/// Main dirction.
/// </summary>
X,
/// <summary>
/// Secondary direction, ortogonal to main.
/// </summary>
Y
}
/// </structural_toolkit_2015>
/// <summary>
/// Classification of typical designs. Design is based on classification of acting forces.
/// </summary>
public enum CalculationType
{
/// <summary>
/// Default value
/// </summary>
Unspecified = 0,
/// <summary>
/// The design of longitudinal reinforcement should be based on full set of forces.
/// </summary>
LongAll = EnabledInternalForces.FX | EnabledInternalForces.MY | EnabledInternalForces.MZ,
/// <summary>
/// Simple bending. Around Y axis.
/// </summary>
BendingY = EnabledInternalForces.MY,
/// <summary>
/// Eccentricyty bending. Axial force and bending around Y axis.
/// </summary>
EccentricBendingY = EnabledInternalForces.FX | EnabledInternalForces.MY,
/// <summary>
/// Simple compression.
/// </summary>
AxialForce = EnabledInternalForces.FX,
/// <summary>
/// The design of transversal reinforcement should be based on full set of forces.
/// </summary>
TransAll = EnabledInternalForces.FY | EnabledInternalForces.FZ | EnabledInternalForces.MX,
/// <summary>
/// Simple shearing.
/// </summary>
ShearingZ = EnabledInternalForces.FZ,
/// <summary>
/// Simple torsion.
/// </summary>
Torsion = EnabledInternalForces.MX,
/// <summary>
/// Simple torsion.
/// </summary>
TorsionWithShearingZ = EnabledInternalForces.FZ | EnabledInternalForces.MX,
}
/// <summary>
/// Type of beam section
/// </summary>
public enum BeamSectionType
{
/// <summary>
/// Section with slab interaction
/// </summary>
WithSlabBeamInteraction,
/// <summary>
/// Section without slab interaction
/// </summary>
WithoutSlabBeamInteraction
}
/// <summary>
/// Type of column structure type
/// </summary>
public enum ColumnStructureType
{
/// <summary>
/// Sway structure
/// </summary>
Sway,
/// <summary>
/// Non-sway structure
/// </summary>
NonSway
}
/// <summary>
/// Converter class
/// </summary>
public static class CalculationTypeHelper
{
/// <summary>
/// Converts a number of EnabledInternalForces flags into CalculationType value indicating type of normal forces
/// </summary>
/// <param name="enabledInternalForces">Collection of EnabledInternalForces flags</param>
/// <returns>CalculationType value describing normal forces in section</returns>
public static CalculationType GetLongitudinalCalculationType( this IEnumerable<EnabledInternalForces> enabledInternalForces)
{
int val = 0;
foreach (CalculationType calculationType in enabledInternalForces)
{
if ((calculationType & CalculationType.LongAll) != 0)
{
val |= (int)calculationType;
}
}
return (CalculationType)val;
}
/// <summary>
/// Converts a number of EnabledInternalForces flags into CalculationType value indicating type of normal transversal forces
/// </summary>
/// <param name="enabledInternalForces">Collection of EnabledInternalForces flags</param>
/// <returns>CalculationType value describing transversal forces in section</returns>
public static CalculationType GetTransversalCalculationType(this IEnumerable<EnabledInternalForces> enabledInternalForces)
{
int val = 0;
foreach (CalculationType calculationType in enabledInternalForces)
{
if ((calculationType & CalculationType.TransAll) != 0)
{
val |= (int)calculationType;
}
}
return (CalculationType)val;
}
/// <structural_toolkit_2015>
/// <summary>
/// Convertion into ForceType
/// </summary>
/// <param name="enabledForce">EnabledForce to be converted</param>
/// <param name="category">Type of element as BuiltInCategory</param>
/// <returns>Forces type as ForceType</returns>
public static Autodesk.Revit.DB.CodeChecking.Engineering.ForceType GetForceType(this EnabledInternalForces enabledForce, Autodesk.Revit.DB.BuiltInCategory category = Autodesk.Revit.DB.BuiltInCategory.OST_BeamAnalytical )
{
switch( category )
{
case Autodesk.Revit.DB.BuiltInCategory.OST_BeamAnalytical:
case Autodesk.Revit.DB.BuiltInCategory.OST_ColumnAnalytical:
{
switch (enabledForce)
{
default: return Autodesk.Revit.DB.CodeChecking.Engineering.ForceType.Unknown;
case EnabledInternalForces.FX: return Autodesk.Revit.DB.CodeChecking.Engineering.ForceType.Fx;
case EnabledInternalForces.FY: return Autodesk.Revit.DB.CodeChecking.Engineering.ForceType.Fy;
case EnabledInternalForces.FZ: return Autodesk.Revit.DB.CodeChecking.Engineering.ForceType.Fz;
case EnabledInternalForces.MX: return Autodesk.Revit.DB.CodeChecking.Engineering.ForceType.Mx;
case EnabledInternalForces.MY: return Autodesk.Revit.DB.CodeChecking.Engineering.ForceType.My;
case EnabledInternalForces.MZ: return Autodesk.Revit.DB.CodeChecking.Engineering.ForceType.Mz;
}
}
case Autodesk.Revit.DB.BuiltInCategory.OST_FloorAnalytical:
case Autodesk.Revit.DB.BuiltInCategory.OST_FoundationSlabAnalytical:
case Autodesk.Revit.DB.BuiltInCategory.OST_WallAnalytical:
{
switch (enabledForce)
{
default: return Autodesk.Revit.DB.CodeChecking.Engineering.ForceType.Unknown;
case EnabledInternalForces.FX: return Autodesk.Revit.DB.CodeChecking.Engineering.ForceType.Fxx;
case EnabledInternalForces.FY: return Autodesk.Revit.DB.CodeChecking.Engineering.ForceType.Fyy;
case EnabledInternalForces.MX: return Autodesk.Revit.DB.CodeChecking.Engineering.ForceType.Mxx;
case EnabledInternalForces.MY: return Autodesk.Revit.DB.CodeChecking.Engineering.ForceType.Myy;
}
}
default: return Autodesk.Revit.DB.CodeChecking.Engineering.ForceType.Unknown;
}
}
/// </structural_toolkit_2015>
}
}
}
@@ -1,605 +0,0 @@
//
// (C) Copyright 2003-2013 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
using System;
using System.Collections.Generic;
using System.Linq;
using Autodesk.Revit.DB.CodeChecking.Engineering;
using Autodesk.CodeChecking.Concrete;
namespace CodeCheckingConcreteExample.Concrete
{
/// <summary>
/// This class provides helpers to use Autodesk.CodeChecking.Concrete component.
/// </summary>
public class RcVerificationHelperUtility
{
/// <summary>
/// Classification of the cross section side for the distribution of the reinforcement.
/// </summary>
private enum CrossSectionSide
{
/// <summary>
/// Top of cross section
/// </summary>
Top,
/// <summary>
/// Bottom of cross section
/// </summary>
Bottom,
/// <summary>
/// Right of cross section
/// </summary>
Right,
/// <summary>
/// Left of cross section
/// </summary>
Left
}
const double geometryEpsilon = 1e-6; // tolerance for polyline which describes of section
int noTopBottom; // the number of bars on the top or bottom side with corner bars
int noLeftRight; // the number of bars on the top or bottom side without corner bars
List<Rebar> rebars; // list of rebars in the cross-section
List<CrossSectionSide> rebarsSide; // list of bars position in the cross-section
SectionShapeType crossSectionType; // the type of cross-section
double rebarCoverTop; // top cover from the edge to the gravity center of bars
double rebarCoverBottom; // bottom cover from the edge to the gravity center of bars
double rebarCover; // the greater cover from the edge to the gravity center of bars
Geometry solverGeometry; // geometry of cross section for solver object
RCSolver solver; // solver
double totalHeight; // the height of the cross section
double totalWidth; // the width of the cross section
double geometryMinX; // minimum x-coordinate on the geometry of the cross section
double geometryMinY; // minimum y-coordinate on the geometry of the cross section
double geometryMaxX; // maximum x-coordinate on the geometry of the cross section
double geometryMaxY; // maximum y-coordinate on the geometry of the cross section
/// <structural_toolkit_2015>
/// <summary>
/// Link between edges of cross section and reinforcement bars.
/// </summary>
Dictionary<CrossSectionSide, Tuple<int,int>> edgesForReinforcement; //
/// <summary>
/// Compares position (coordinates) using a tolerance of geometry.
/// </summary>
/// <param name="FirstPosition">First position of geometry</param>
/// <param name="SecondPosition">Second position of geometry</param>
/// <returns>
/// Less than zero - FirstPosition is less than SecondPosition.
/// Zero - FirstPosition is equal to SecondPosition
/// Greater than zero - FirstPosition is greater than SecondPosition.
/// </returns>
static int CompareGeomety(double FirstPosition, double SecondPosition)
{
int compare = -1;
if (Math.Abs(FirstPosition - SecondPosition) < geometryEpsilon)
compare = 0;
else if (FirstPosition > SecondPosition)
compare = 1;
return compare;
}
/// </structural_toolkit_2015>
/// <summary>
/// Initializes a new instance of the new RC calculation helper object.
/// </summary>
/// <param name="type">The type of the cross-section</param>
/// <param name="rcGeometry">Set of geometry parameters.</param>
/// <param name="coverTop">The top cover - to the reinforcement ceneter.</param>
/// <param name="coverBottom">The top cover - to the reinforcement ceneter.</param>
private RcVerificationHelperUtility(SectionShapeType type, ref Geometry rcGeometry, double coverTop, double coverBottom)
{
totalHeight = 0; // initial value of the height of the cross section
totalWidth = 0; // initial value of the width of the cross section
noTopBottom = 5; // initial value of the number of bars on top and bottom
noLeftRight = noTopBottom - 2; // initial value of the number of bars on left and right
solverGeometry = new Geometry(); // initialization of new geometry
rebars = new List<Rebar>(); // initialization of rebars list
rebarsSide = new List<CrossSectionSide>(); // initialization of bars position list
crossSectionType = type; // set of section type
rebarCover = Math.Max(coverTop, coverBottom); // set of maximum cover
rebarCoverTop = coverTop; // set of top cover
rebarCoverBottom = coverBottom; // set of bottom cover
/// <structural_toolkit_2015>
edgesForReinforcement = new Dictionary<CrossSectionSide, Tuple<int, int>>();
geometryMinX = Double.MaxValue;
geometryMinY = Double.MaxValue;
geometryMaxX = Double.MinValue;
geometryMaxY = Double.MinValue;
/// </structural_toolkit_2015>
// Top,bottom, lreft and right edges are searched, based on maximum and minimum values for x and y coordinates
/// <structural_toolkit_2015>
solverGeometry = rcGeometry;
int count = solverGeometry.Count;
Point2D p = new Point2D(0, 0);
// The orientation is changed if it is necessary.
if (solverGeometry.isClockwiseOrientation()) // clockwise direction
{
Geometry tmpGeometry = new Geometry();
p = solverGeometry.Point(0);
tmpGeometry.Add(p.X, p.Y);
for (int i = count-1; i > 0; i--)
{
p = solverGeometry.Point(i);
tmpGeometry.Add(p.X, p.Y);
}
solverGeometry = tmpGeometry;
}
foreach (Point2D p2D in solverGeometry)
{
geometryMinX = Math.Min(geometryMinX, p2D.X);
geometryMinY = Math.Min(geometryMinY, p2D.Y);
geometryMaxX = Math.Max(geometryMaxX, p2D.X);
geometryMaxY = Math.Max(geometryMaxY, p2D.Y);
}
Tuple<int, int> curentTuple = null;
for (int i = 0; i < count; i++)
{
p = solverGeometry.Point(i);
// Left
if (CompareGeomety(geometryMinX,p.X) >= 0)
{
if (!edgesForReinforcement.ContainsKey(CrossSectionSide.Left) || CompareGeomety(geometryMinX,p.X) > 0)
curentTuple = new Tuple<int, int>(i, i);
else
{
if (CompareGeomety(p.Y, solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Left].Item2).Y) > 0)
curentTuple = new Tuple<int, int>(edgesForReinforcement[CrossSectionSide.Left].Item1, i);
else if (CompareGeomety(p.Y, solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Left].Item1).Y) < 0)
curentTuple = new Tuple<int, int>(i, edgesForReinforcement[CrossSectionSide.Left].Item2);
}
edgesForReinforcement.Remove(CrossSectionSide.Left);
edgesForReinforcement.Add(CrossSectionSide.Left, curentTuple);
}
// Right
if (CompareGeomety(geometryMaxX,p.X) <= 0)
{
if (!edgesForReinforcement.ContainsKey(CrossSectionSide.Right) || CompareGeomety(geometryMaxX,p.X) < 0)
curentTuple = new Tuple<int, int>(i, i);
else
{
if (CompareGeomety(p.Y, solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Right].Item2).Y) > 0)
curentTuple = new Tuple<int, int>(edgesForReinforcement[CrossSectionSide.Right].Item1, i);
else if (CompareGeomety(p.Y, solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Right].Item1).Y) < 0)
curentTuple = new Tuple<int, int>(i, edgesForReinforcement[CrossSectionSide.Right].Item2);
}
edgesForReinforcement.Remove(CrossSectionSide.Right);
edgesForReinforcement.Add(CrossSectionSide.Right, curentTuple);
}
// Top
if (CompareGeomety(geometryMaxY,p.Y) <= 0)
{
if (!edgesForReinforcement.ContainsKey(CrossSectionSide.Top) || CompareGeomety(geometryMaxY,p.Y) < 0)
{
curentTuple = new Tuple<int, int>(i, i);
}
else
{
if (CompareGeomety(p.X, solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Top].Item2).X) > 0)
curentTuple = new Tuple<int, int>(edgesForReinforcement[CrossSectionSide.Top].Item1, i);
else if (CompareGeomety(p.X, solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Top].Item1).X) < 0)
curentTuple = new Tuple<int, int>(i, edgesForReinforcement[CrossSectionSide.Top].Item2);
}
edgesForReinforcement.Remove(CrossSectionSide.Top);
edgesForReinforcement.Add(CrossSectionSide.Top, curentTuple);
}
// Bottom
if (CompareGeomety(geometryMinY,p.Y) >= 0)
{
if (!edgesForReinforcement.ContainsKey(CrossSectionSide.Bottom) || CompareGeomety(geometryMinY,p.Y) > 0)
{
curentTuple = new Tuple<int, int>(i, i);
}
else
{
if (CompareGeomety(p.X, solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Bottom].Item2).X) > 0)
curentTuple = new Tuple<int, int>(edgesForReinforcement[CrossSectionSide.Bottom].Item1, i);
else if (CompareGeomety(p.X, solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Bottom].Item1).X) < 0)
curentTuple = new Tuple<int, int>(i, edgesForReinforcement[CrossSectionSide.Bottom].Item2);
}
edgesForReinforcement.Remove(CrossSectionSide.Bottom);
edgesForReinforcement.Add(CrossSectionSide.Bottom, curentTuple);
}
}
/// </structural_toolkit_2015>
totalHeight = (geometryMaxY - geometryMinY);
totalWidth = (geometryMaxX - geometryMinX);
solver = RCSolver.CreateNewSolver(solverGeometry); // solver with geometry redy to use.
}
/// <summary>
/// Create the new RC calculation object.
/// </summary>
/// <param name="type">The type of the cross-section</param>
/// <param name="rcGeometry">Set of geometry parameters.</param>
/// <param name="coverTop">The top cover - to the reinforcement ceneter.</param>
/// <param name="coverBottom">The top cover - to the reinforcement ceneter.</param>
/// <returns>New RcVerificationHelperUtility object.</returns>
public static RcVerificationHelperUtility CreateRcVerificationHelperUtility(SectionShapeType type, ref Geometry rcGeometry, double coverTop, double coverBottom)
{
if (SectionShapeType.RectangularBar != type && SectionShapeType.T != type)
throw new Exception("CreateRcVerificationHelperUtility.Unhandled cross section type. 3th party parameterization are necessary.");
// If you need to take into account other section you should modyfy SetReinforcementAsBar & GetReinforcementLine before you remove this exception!
RcVerificationHelperUtility newUtility = new RcVerificationHelperUtility(type, ref rcGeometry, coverTop, coverBottom);
return newUtility;
}
/// <summary>
/// Set reinforcement on every cross-section corner.
/// </summary>
/// <param name="oneRebarArea">Area of each rebar.</param>
public void SetCornerReinforcement(double oneRebarArea)
{
SetReinforcementAsBar(oneRebarArea, oneRebarArea, 0.0, 0.0, 2, 2, 0, 0);
}
/// <summary>
/// Set reinforcement on the top and bottom of the section.
/// </summary>
/// <param name="topReinf">Area of top reinforcment.</param>
/// <param name="bottomReinf">Area of bottom reinforcment.</param>
public void SetReinforcement(double topReinf, double bottomReinf)
{
SetReinforcementAsBar(0.5 * topReinf, 0.5 * bottomReinf, 0.0, 0.0, 2, 2, 0, 0);
}
/// <summary>
/// Set reinforcemenet on every side of cross-section.
/// </summary>
/// <param name="topReinf">Area of top reinforcment.</param>
/// <param name="bottomReinf">Area of bottom reinforcment.</param>
/// <param name="rightReinf">Area of right reinforcment.</param>
/// <param name="leftReinf">Area of left reinforcment.</param>
public void SetReinforcement(double topReinf, double bottomReinf, double rightReinf, double leftReinf)
{
int barNo = rebars.Count();
int noRebarMax = 2 * (noTopBottom + noLeftRight);
topReinf /= (double)noTopBottom;
bottomReinf /= (double)noTopBottom;
rightReinf /= (double)noLeftRight;
leftReinf /= (double)noLeftRight;
if (barNo == noRebarMax && Math.Abs(topReinf * bottomReinf * rightReinf * leftReinf) > Double.Epsilon)
{
for (int i = 0; i < barNo; i++)
{
switch (rebarsSide[i])
{
case CrossSectionSide.Top:
rebars[i].Area = topReinf;
break;
case CrossSectionSide.Bottom:
rebars[i].Area = bottomReinf;
break;
case CrossSectionSide.Right:
rebars[i].Area = rightReinf;
break;
case CrossSectionSide.Left:
rebars[i].Area = leftReinf;
break;
}
}
solver.SetRebars(rebars);
}
else
{
SetReinforcementAsBar(topReinf, bottomReinf, rightReinf, leftReinf, noTopBottom, noTopBottom, noLeftRight, noLeftRight);
}
}
/// <summary>
/// Set the concrete parameters for calculation.
/// </summary>
/// <param name="concrete">Set of reinforcement concrete parameters.</param>
public void SetConcrete(Autodesk.CodeChecking.Concrete.Concrete concrete)
{
solver.SetConcrete(concrete);
}
/// <summary>
/// Set the concrete parameters for calculation.
/// </summary>
/// <param name="stressStrainType">Stress-strain relationship. The type of the concrete mechanical behaviour.</param>
/// <param name="strenght">Concrete strenght.</param>
/// <param name="youngModulus">Modulus of elasticyty - Young modulus for concrete.</param>
public void SetConcrete(Autodesk.CodeChecking.Concrete.StressDiagramType stressStrainType, double strenght, double youngModulus)
{
Autodesk.CodeChecking.Concrete.Concrete newConcrete = new Autodesk.CodeChecking.Concrete.Concrete();
double MaximumStrain = 0.0035; // The variable dependent to RC code.!
double CompressionReductionFactor = 0.8; // The variable dependent to RC code. Only for D_REC stressStrainType!
switch (stressStrainType)
{
case Autodesk.CodeChecking.Concrete.StressDiagramType.Linear:
newConcrete.SetStrainStressModelLinear(strenght, strenght / youngModulus, youngModulus);
break;
case Autodesk.CodeChecking.Concrete.StressDiagramType.Rectangular:
newConcrete.SetStrainStressModelRectangular(strenght, MaximumStrain, youngModulus, CompressionReductionFactor);
break;
default:
// Other cases could be necessary for some design codes.
// Other variables dependent to RC code could be necessary for parameterization!
throw new Exception("SetConcrete. Unhandled type. 3th party implementation are necessary in this point.");
}
SetConcrete(newConcrete);
}
/// <summary>
/// Set the reinforcement steel parameters for calculation.
/// </summary>
/// <param name="strenght">Steel strenght.</param>
/// <param name="modulusOfElasticity">Modulus of elasticyty - Young modulus for steel.</param>
/// <param name="strainUltimateLimit">Limit of strain - maximum steel strain.</param>
/// <param name="hardeningFactor">Hardening factor - increase of strength on the plastic behaviour part.</param>
public void SetSteel(double strenght, double modulusOfElasticity, double strainUltimateLimit, double hardeningFactor)
{
Autodesk.CodeChecking.Concrete.Steel newSteel = new Autodesk.CodeChecking.Concrete.Steel();
newSteel.ModulusOfElasticity = modulusOfElasticity;
newSteel.DesignStrength = strenght;
newSteel.HardeningFactor = hardeningFactor; // The variable dependent to RC code.!
// Sometimes 1.0 value(without Hardening) is makes some problems with iteration process.
// Little value bigger the 1.0 is removed this problems and is safer.
newSteel.StrainUltimateLimit = strainUltimateLimit; // The variable dependent to RC code.!
solver.SetSteel(newSteel);
double yieldStrain = newSteel.DesignStrength / newSteel.ModulusOfElasticity;
int minStep = (int)Math.Ceiling(newSteel.StrainUltimateLimit / yieldStrain);
//noTopBottom = 2*Math.Max(5, minStep);
//noLeftRight = minStep - 2;
}
/// <summary>
/// Set identical rebars in the concrete cross section.
/// </summary>
/// <param name="oneBarArea">The area of a single bar.</param>
/// <param name="noBarBottom">The number of bars placed on the bottom.</param>
/// <param name="noBarTop">The number of bars placed on the top.</param>
/// <param name="noBarLeft">The number of bars placed on the left</param>
/// <param name="noBarRight">The number of bars placed on the right</param>
void SetReinforcementAsBar(double oneBarArea, int noBarTop, int noBarBottom, int noBarRight, int noBarLeft)
{
SetReinforcementAsBar(oneBarArea * noBarTop, oneBarArea * noBarBottom, oneBarArea * noBarRight, oneBarArea * noBarLeft, noBarTop, noBarBottom, noBarRight, noBarLeft);
}
/// <summary>
/// Set rebars in the concrete cross section.
/// </summary>
/// <param name="bottomBarArea">The area of reinforcement on the bottom of section.</param>
/// <param name="topBarArea">The area of reinforcement on the top of section.</param>
/// <param name="leftBarArea">The area of reinforcement on the left of section.</param>
/// <param name="rightBarArea">The area of reinforcement on the right of section.</param>
/// <param name="noBarBottom">The number of bars placed on the bottom.</param>
/// <param name="noBarTop">The number of bars placed on the top.</param>
/// <param name="noBarLeft">The number of bars placed on the left</param>
/// <param name="noBarRight">The number of bars placed on the right</param>
void SetReinforcementAsBar(double topBarArea, double bottomBarArea, double rightBarArea, double leftBarArea, int noBarTop, int noBarBottom, int noBarRight, int noBarLeft)
{
rebars.Clear();
rebarsSide.Clear();
Point2D BeginLinePoint = new Point2D(0, 0);
Point2D EndLinePoint = new Point2D(0, 0);
/// <structural_toolkit_2015>
//BOTTOM
if (bottomBarArea > 0.0)
{
BeginLinePoint = solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Bottom].Item1);
EndLinePoint = solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Bottom].Item2);
BeginLinePoint.X += rebarCover;
EndLinePoint.X -= rebarCover;
BeginLinePoint.Y += rebarCoverBottom;
EndLinePoint.Y += rebarCoverBottom;
SetReinforcementBarsOnLine(ref BeginLinePoint, ref EndLinePoint, ref bottomBarArea, ref noBarBottom, false, CrossSectionSide.Bottom);
}
//RIGHT
if (rightBarArea > 0.0)
{
BeginLinePoint = solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Right].Item1);
EndLinePoint = solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Right].Item2);
BeginLinePoint.X -= rebarCover;
EndLinePoint.X -= rebarCover;
BeginLinePoint.Y += rebarCoverBottom;
EndLinePoint.Y -= rebarCoverTop;
SetReinforcementBarsOnLine(ref BeginLinePoint, ref EndLinePoint, ref rightBarArea, ref noBarRight, true, CrossSectionSide.Right);
}
//TOP
if (topBarArea > 0.0)
{
BeginLinePoint = solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Top].Item1);
EndLinePoint = solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Top].Item2);
BeginLinePoint.X += rebarCover;
EndLinePoint.X -= rebarCover;
BeginLinePoint.Y -= rebarCoverTop;
EndLinePoint.Y -= rebarCoverTop;
SetReinforcementBarsOnLine(ref BeginLinePoint, ref EndLinePoint, ref topBarArea, ref noBarTop, false, CrossSectionSide.Top);
}
//LEFT
if (leftBarArea > 0.0)
{
BeginLinePoint = solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Left].Item1);
EndLinePoint = solverGeometry.Point(edgesForReinforcement[CrossSectionSide.Left].Item2);
BeginLinePoint.X += rebarCover;
EndLinePoint.X += rebarCover;
BeginLinePoint.Y += rebarCoverBottom;
EndLinePoint.Y -= rebarCoverTop;
SetReinforcementBarsOnLine(ref BeginLinePoint, ref EndLinePoint, ref leftBarArea, ref noBarLeft, true, CrossSectionSide.Left);
}
solver.SetRebars(rebars);
}
/// <summary>
/// Set the rebar beetwin two points.
/// </summary>
/// <param name="beginPoint">First point of reinforcing line.</param>
/// <param name="endPoint">Last point of reinforcing line.</param>
/// <param name="oneBarArea">The area of reinforcement.</param>
/// <param name="noBars">The number of bars placed on the line.</param>
/// <param name="hasNoCornerBars">If true the rebar will be placed on the ends of line.</param>
/// <param name="position">The information about classification of the rebar as top, bottom, right or left.</param>
void SetReinforcementBarsOnLine(ref Point2D beginPoint, ref Point2D endPoint, ref double oneBarArea, ref int noBars, bool hasNoCornerBars, CrossSectionSide position)
{
if (noBars > 0 && oneBarArea > 0.0)
{
int noSpace = noBars + (hasNoCornerBars ? 1 : -1);
double fdX = (endPoint.X - beginPoint.X);
double fdY = (endPoint.Y - beginPoint.Y);
fdX /= noSpace;
fdY /= noSpace;
if (hasNoCornerBars)
{
for (int i = 1; i < noSpace; i++)
{
Rebar bar = new Rebar(beginPoint.X + i * fdX, beginPoint.Y + i * fdY, oneBarArea);
rebars.Add(bar);
rebarsSide.Add(position);
}
}
else
{
for (int i = 0; i <= noSpace; i++)
{
Rebar bar = new Rebar(beginPoint.X + i * fdX, beginPoint.Y + i * fdY, oneBarArea);
rebars.Add(bar);
rebarsSide.Add(position);
}
}
}
}
/// <summary>
/// Calculates the safety factor.
/// </summary>
/// <param name="inNMM">The acting forces.</param>
/// <returns>Safety factor. Resistance forces to acting forces ratio.</returns>
public double SafetyFactor(InternalForcesContainer inNMM)
{
double safetyFactor = -1.0;
try
{
solver.SolveResistance(inNMM.ForceFx, -inNMM.MomentMy, inNMM.MomentMz);
}
catch (Exception e)
{
throw e;
}
SetOfForces solveNMM = solver.GetInternalForces(Autodesk.CodeChecking.Concrete.ResultType.Section);
if (Math.Abs(inNMM.ForceFx) > Math.Abs(inNMM.MomentMy))
{
if (Math.Abs(inNMM.ForceFx) > Math.Abs(inNMM.MomentMz))
safetyFactor = solveNMM.AxialForce / inNMM.ForceFx;
else
safetyFactor = solveNMM.MomentY / inNMM.MomentMz;
}
else if (Math.Abs(inNMM.MomentMy) > Math.Abs(inNMM.MomentMz))
{
safetyFactor = solveNMM.MomentX / -inNMM.MomentMy;
}
else
{
safetyFactor = solveNMM.MomentY / inNMM.MomentMz;
}
return safetyFactor;
}
/// <summary>
/// Calculates the safety factor and sets additional result in the lists.
/// </summary>
/// <param name="inNMM">The acting forces.</param>
/// <param name="concreteStresses">
/// Reference to modify object. The list is set after safety factor calculation. Includes stresses on every corner of the cross section.
/// </param>
/// <param name="steelStresses">
/// Reference to modify object. The list is set after safety factor calculation. Includes stresses on every rebar.
/// </param>
/// <returns>Safety factor. Resistance forces to acting forces ratio.</returns>
public double SafetyFactor(InternalForcesContainer inNMM, ref List<double> concreteStresses, ref List<double> steelStresses)
{
double safetyFactor = SafetyFactor(inNMM);
int no = solverGeometry.Count;
double stress = 0;
for (int i = 0; i < no; i++)
{
stress = solver.GetStress(Autodesk.CodeChecking.Concrete.ResultType.Concrete, i);
concreteStresses.Add(stress);
}
no = solver.GetRebars().Count;
for (int i = 0; i < no; i++)
{
stress = solver.GetStress(Autodesk.CodeChecking.Concrete.ResultType.Rebars, i);
steelStresses.Add(stress);
}
return safetyFactor;
}
/// <structural_toolkit_2015>
/// <summary>
/// Calculate the moment of inertia for cracking section.
/// </summary>
/// <param name="inNMM">The acting forces.</param>
/// <returns>Returns moment of inertia for cracking section.</returns>
public double InertiaOfCrackingSection(InternalForcesContainer inNMM)
{
double momentOfInertiaCrackingConcreteSection = 0.0;
SafetyFactor(inNMM);
SetOfForces solverNMM = solver.GetInternalForces(Autodesk.CodeChecking.Concrete.ResultType.Section);
double neutralAxisDist = solver.GetNeutralAxisDistance();
double stressArea = solver.GetConcreteStressArea();
double comprHeight = 0.5 * totalHeight + neutralAxisDist;
Steel steel = solver.GetSteel();
Autodesk.CodeChecking.Concrete.Concrete concrete = solver.GetConcrete();
double n = steel.ModulusOfElasticity / concrete.ModulusOfElasticity;
switch (crossSectionType)
{
case SectionShapeType.RectangularBar:
{
momentOfInertiaCrackingConcreteSection = comprHeight * comprHeight * stressArea / 3.0; // bh^3/12 + b*h*(0.5*h)^2, b*h=stressArea
}
break;
default:
throw new Exception("InertiaOfCrackingSection. Unhandled cross section type. Only rectangular cross-section can be used on this path. 3th party implementation is necessary.");
}
foreach (Rebar bar in solver.GetRebars())
{
momentOfInertiaCrackingConcreteSection += n * bar.Area * Math.Pow((bar.Y + neutralAxisDist),2);
}
return momentOfInertiaCrackingConcreteSection;
}
/// <summary>
/// Calculate the acting forces to Cracking forces ratio.
/// </summary>
/// <param name="inNMM">The acting forces.</param>
/// <param name="crackingStress">Stress limit for cracking/uncracking section.</param>
/// <returns>Acting forces to cracking forces ratio</returns>
public double ForcesToCrackingForces(InternalForcesContainer inNMM, double crackingStress)
{
double forcesToCrackigForces = 0;
if (!CalculationUtility.IsZeroM(inNMM.MomentMz))
{
throw new Exception("Deflection calculation is not aviable for biaxial bending.");
}
double actingForcesStress = 0;
if(!CalculationUtility.IsZeroM(inNMM.MomentMy))
{
double w = solverGeometry.MomentOfInertiaX;
w /= inNMM.MomentMy > 0.0 ? (geometryMaxY - solverGeometry.CenterOfInertia.Y) : (solverGeometry.CenterOfInertia.Y - geometryMinY);
actingForcesStress += Math.Abs(inNMM.MomentMy) / w;
}
if (!CalculationUtility.IsZeroN(inNMM.ForceFx))
{
actingForcesStress += -inNMM.ForceFx / solverGeometry.Area;
}
if (actingForcesStress >= 0)
{
forcesToCrackigForces = actingForcesStress / crackingStress ;
}
return forcesToCrackigForces;
}
/// </structural_toolkit_2015>
}
}
@@ -1,175 +0,0 @@
//
// (C) Copyright 2003-2013 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CodeCheckingConcreteExample.Concrete
{
/// <summary>
/// Class describe reinforcement data and results.
/// </summary>
public class Reinforcement
{
private double spacing, asTop, asBottom, asRight, asLeft;
private double strength;
private double designStrength;
private double transversalDensity;
private Reinforcement() { }
/// <summary>
/// Create reinforcement object based on steel parameters.
/// </summary>
/// <param name="steelStrenght">The design strenght of steel.</param>
public Reinforcement(double steelStrenght)
{
Reset();
strength = steelStrenght;
designStrength = strength;
ModulusOfElasticity = 200e9;
}
/// <summary>
/// Set all variables in the <see cref="Reinforcement"/> object to defult valus: areas to 0.0 spacig to float.MaxValue
/// </summary>
public void Reset()
{
spacing = float.MaxValue;
asTop = asBottom = asRight = asLeft = 0.0;
CurrentAsTop = CurrentAsBottom = CurrentAsRight = CurrentAsLeft = 0.0;
CurrentSpacing = float.MaxValue;
}
/// <summary>
/// Gets or sets the current (temporary) stirupp spacing.
/// </summary>
public double CurrentSpacing { get; set; }
/// <summary>
/// Gets or sets the current (temporary) area of top reinforcement.
/// </summary>
public double CurrentAsTop { get; set; }
/// <summary>
/// Gets or sets the current (temporary) area of bottom reinforcement.
/// </summary>
public double CurrentAsBottom { get; set; }
/// <summary>
/// Gets or sets the current (temporary) area of right reinforcement.
/// </summary>
public double CurrentAsRight { get; set; }
/// <summary>
/// Gets or sets the current (temporary) area of left reinforcement.
/// </summary>
public double CurrentAsLeft { get; set; }
/// <summary>
/// Gets or sets the modulus of elasticyty (Young modulus).
/// </summary>
public double ModulusOfElasticity { get; set; }
/// <summary>
/// Gets the stirupp spacing (finial).
/// </summary>
public double Spacing { get { return spacing; } }
/// <summary>
/// Gets the area of top reinforcement (finial).
/// </summary>
public double AsTop { get { return asTop; } }
/// <summary>
/// Gets the area of bottom reinforcement (finial).
/// </summary>
public double AsBottom { get { return asBottom; } }
/// <summary>
/// Gets the area of right reinforcement (finial).
/// </summary>
public double AsRight { get { return asRight; } }
/// <summary>
/// Gets the area of left reinforcement (finial).
/// </summary>
public double AsLeft { get { return asLeft; } }
/// <summary>
/// Gets the design strenght.
/// </summary>
public double Strength { get { return designStrength; } }
/// <summary>
/// Sets design strength according to current limit state. The strength is divided by safety factor.
/// </summary>
/// <param name="factor">Safety factor</param>
public void SetStrenghtPartialFactor(double factor)
{
designStrength = strength / factor;
}
/// <summary>
/// Sets trensversal reinforcement density acording to number of stirrupas arms, transversal bar area and spacuing.
/// </summary>
/// <param name="numberOfStirrupsArms">The number of arms in one frame of stirrup.</param>
/// <param name="oneArmArea">The area of one transversal bar. One of stirrups arms.</param>
public void SetTransversalDensity(int numberOfStirrupsArms, double oneArmArea)
{
transversalDensity = (oneArmArea * numberOfStirrupsArms) / spacing;
}
/// <summary>
/// Gets the stirrups dencity
/// </summary>
public double TransversalDensity { get { return transversalDensity; } }
/// <summary>
/// Calculates total reinforcement area.
/// </summary>
/// <returns>Returns sum of reinforcement area.</returns>
public double TotalSectionReinforcement()
{
return asTop + asBottom + asRight + asLeft;
}
/// <summary>
/// Sets finial resulat <see cref="Spacing"/>, <see cref="AsTop"/>, <see cref="AsBottom"/>, <see cref="AsRight"/>, <see cref="AsLeft"/> ) based on curent valus.
/// </summary>
/// <remarks>
/// <para>For longitudinal reinforcement: the final areas are set as maksimum of current value and previous final value. </para>
/// <para>For transversal reinforcement: the final areas are set as sum of current value and previous final value,
/// final spacing is set as minimum of current spacing and previous final spacing.</para>
/// </remarks>
public void CurrentToFinial()
{
spacing = Math.Min(CurrentSpacing, spacing);
asTop = Math.Max(CurrentAsTop, asTop);
asBottom = Math.Max(CurrentAsBottom, asBottom);
asRight = Math.Max(CurrentAsRight, asRight);
asLeft = Math.Max(CurrentAsLeft, asLeft);
}
}
}