GetLoadTargetForce



Your Ad Here

Syntax

SapObject.SapModel.LinkElm.GetLoadTargetForce

VB6 Procedure

Function GetLoadTargetForce(ByVal Name As String, ByRef NumberItems As Long, ByRef LinkName() As String, ByRef LoadCase() As String, ByRef dof1() As Boolean, ByRef dof2() As Boolean, ByRef dof3() As Boolean, ByRef dof4() As Boolean, ByRef dof5() As Boolean, ByRef dof6() As Boolean, ByRef P() As Double, ByRef V2() As Double, ByRef V3() As Double, ByRef T() As Double, ByRef M2() As Double, ByRef M3() As Double, ByRef T1() As Double, ByRef T2() As Double, ByRef T3() As Double, ByRef T4() As Double, ByRef T5() As Double, ByRef T6() As Double, Optional ByVal ItemType As eItemType = Object) As Long

Parameters

Name

The name of an existing link object, link element or group of objects, depending on the value of the ItemTypeElm item.

NumberItems

The total number of deformation loads retrieved for the specified link elements.

LinkName

This is an array that includes the name of the link element associated with each target force.

LoadCase

This is an array that includes the name of the load case associated with each target force.

dof1, dof2, dof3, dof4, dof5, dof6

These are arrays of boolean values indicating if the considered degree of freedom has a target force assignment.

dof1 = P

dof2 = V2

dof3 = V3

dof4 = T

dof5 = M2

dof6 = M3

P, V2, V3, T, M2, M3

These are arrays of target force values. The target forces specified for a given degree of freedom are applicable only if the corresponding DOF item for that degree of freedom is True.

U1 = U1 deformation [L]

U2 = U2 deformation [L]

U3 = U3 deformation [L]

R1 = R1 deformation [rad]

R2 = R2 deformation [rad]

R3 = R3 deformation [rad]

T1, T2, T3, T4, T5, T6

These are arrays of the relative distances along the link elements where the target force values apply. The relative distances specified for a given degree of freedom are applicable only if the corresponding dofn item for that degree of freedom is True.

T1 = relative location for P target force

T2 = relative location for V2 target force

T3 = relative location for V3 target force

T4 = relative location for T target force

T5 = relative location for M2 target force

T6 = relative location for M3 target force

ItemTypeElm

This is one of the following items in the eItemTypeElm enumeration:

ObjectElm = 0

Element = 1

GroupElm = 2

SelectionElm = 3

 

If this item is ObjectElm, the load assignments are retrieved for the link elements corresponding to the link object specified by the Name item.

If this item is Element, the load assignments are retrieved for the link element specified by the Name item.

If this item is GroupElm, the load assignments are retrieved for the link elements corresponding to all link objects included in the group specified by the Name item.

If this item is SelectionElm, the load assignments are retrieved for link elements corresponding to all selected link objects, and the Name item is ignored.

Remarks

This function retrieves the target force assignments to link elements.

The function returns zero if the target force assignments are successfully retrieved; otherwise it returns a nonzero value.

VBA Example

Sub GetLinkElmTargetForce()
   'dimension variables
      Dim SapObject As Sap2000.SapObject
      Dim SapModel As cSapModel
      Dim ret As Long
      Dim DOF() As Boolean
      Dim f() As double
      Dim RD() As double
      Dim NumberItems As Long
      Dim LinkName() As String
      Dim LoadCase() As String
      Dim dof1() As Boolean
      Dim dof2() As Boolean
      Dim dof3() As Boolean
      Dim dof4() As Boolean
      Dim dof5() As Boolean
      Dim dof6() As Boolean
      Dim P() As Double
      Dim V2() As Double
      Dim V3() As Double
      Dim T() As Double
      Dim M2() As Double
      Dim M3() As Double
      Dim T1() As Double
      Dim T2() As Double
      Dim T3() As Double
      Dim T4() As Double
      Dim T5() As Double
      Dim T6() As Double
      Dim Name1 As String
      Dim Name2 As String

   'create Sap2000 object
      Set SapObject = New SAP2000.SapObject

   'start Sap2000 application
      SapObject.ApplicationStart

   'create SapModel object
      Set SapModel = SapObject.SapModel

   'initialize model
      ret = SapModel.InitializeNewModel

   'create model from template
      ret = SapModel.File.New2DFrame(PortalFrame, 2, 144, 2, 288)

   'add link object by points
      ret = SapModel.LinkObj.AddByPoint("3", "", Name1, True)
      ret = SapModel.LinkObj.AddByPoint("1", "5", Name2)

   'refresh view
      ret = SapModel.View.RefreshView

   'assign link object target force
      ReDim DOF(5)
      ReDim f(5)
      ReDim RD(5)
      DOF(0) = True
      f(0) = 50
      RD(0) = 0.4
      ret = SapModel.LinkObj.SetLoadTargetForce("ALL", "DEAD", DOF, f, RD, Group)

   'create the analysis model
      ret = SapModel.Analyze.CreateAnalysisModel

   'get link element target force
      ret = SapModel.LinkElm.GetLoadTargetForce("ALL", NumberItems, LinkName, LoadCase, dof1, dof2, dof3, dof4, dof5, dof6, P, V2, V3, T, M2, M3, T1, T2, T3, T4, T5, T6, GroupElm)

   'close Sap2000
      SapObject.ApplicationExit False
      Set SapModel = Nothing
      Set SapObject = Nothing
End Sub

Release Notes

Initial release in version 11.00.

See Also

Return to SAP2000 Index


Your Ad Here