GetMemberForces Method


Gets the member forces associated with this element.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Since: 2016

Syntax

C#
public IList<MemberForces> GetMemberForces()
Visual Basic
Public Function GetMemberForces As IList(Of MemberForces)
Visual C++
public:
IList<MemberForces^>^ GetMemberForces()

Return Value

Returns a collection of Member Forces associated with this element. Empty collection will be returned if element doesn't have any Member Forces. To find out with which end member forces are associated use [!:Autodesk::Revit::DB::Structure::MemberForces::Position] property to obtain a position of Member Forces on element.

Remarks

Using this method require transaction. Member forces are strictly related with releases. This means that we can obtain member forces values only for directions that have releases set to false. Force or moment component on direction that have release set to true is skipped (zeroed) during getting.

Examples

Copy C#
/// <summary>
/// Get the meber forces at the start of a beam
/// </summary>
public MemberForces GetStartMemberForces(FamilyInstance beam)
{
    MemberForces startForces = null;
    AnalyticalModelStick ams = beam.GetAnalyticalModel() as AnalyticalModelStick;
    if (ams != null)
    {
        IList<MemberForces> beamForces = ams.GetMemberForces();
        foreach (MemberForces forces in beamForces)
        {
            if (forces.Start == true)
            {
                startForces = forces;
                break;
            }
        }
    }

    return startForces;
}
Copy VB.NET
  ''' <summary>
  ''' Get the member forces at the start of a beam
  ''' </summary>
  Public Function GetStartMemberForces(beam As FamilyInstance) As MemberForces
   Dim startForces As MemberForces = Nothing
   Dim ams As AnalyticalModelStick = TryCast(beam.GetAnalyticalModel(), AnalyticalModelStick)
   If ams IsNot Nothing Then
      Dim beamForces As IList(Of MemberForces) = ams.GetMemberForces()
      For Each forces As MemberForces In beamForces
         If forces.Start = True Then
            startForces = forces
            Exit For
         End If
      Next
   End If

   Return startForces
End Function

See Also