GetSpring



Your Ad Here

Syntax

SapObject.SapModel.AreaObj.GetSpring

VB6 Procedure

Function GetSpring(ByVal Name As String, ByRef NumberSprings As Long, ByRef MyType() As Long, ByRef s() As Double, ByRef SimpleSpringType() As Long, ByRef LinkProp() As String, ByRef Face() As Long, ByRef SpringLocalOneType() As Long, ByRef Dir() As Long, ByRef Outward() As Boolean, ByRef VecX() As Double, ByRef VecY() As Double, ByRef VecZ() As Double, ByRef CSys() As String, ByRef Ang() As Double) As Long

Parameters

Name

The name of an existing area object.

NumberSprings

The number of spring assignments made to the specified area object.

MyType

Each value in this array is either 1 or 2, indicating the spring property type.

1 = Simple spring

2 = Link property

s

Each value in this array is the simple spring stiffness per unit area of the specified area object face. This item applies only when the corresponding MyType = 1. [F/L3]

SimpleSpringType

Each value in this array is 1, 2 or 3, indicating the simple spring type. This item applies only when the corresponding MyType = 1.

1 = Spring resists tension and compression

2 = Spring resists compression only

3 = Spring resists tension only

LinkProp

Each value in this array is the name of the link property assigned to the spring. This item applies only when the corresponding MyType = 2.

Face

Each value in this array is -1, -2 or a nonzero, positive integer, indicating the area object face to which the specified spring assignment applies.

-1 = Bottom face

-2 = Top face

>0 = Edge face

 

Note that edge face n is from area object point n to area object point n + 1. For example, edge face 2 is from area object point 2 to area object point 3.

SpringLocalOneType

Each value in this array is 1, 2 or 3, indicating the method used to specify the spring positive local 1-axis orientation.

1 = Parallel to area object local axis

2 = Normal to specified area object face

3 = User specified direction vector

Dir

Each value in this array is 1, 2, 3, -1, -2 or -3, indicating the area object local axis that corresponds to the positive local 1-axis of the spring. This item applies only when the corresponding SpringLocalOneType = 1.

Outward

Each value in this array is True if the spring positive local 1 axis is outward from the specified area object face. This item applies only when SpringLocalOneType = 2.

VecX

Each value in this array is the X-axis or area object local 1-axis component (depending on the CSys specified) of the user specified direction vector for the spring local 1-axis. The direction vector is in the coordinate system specified by the CSys item. This item applies only when the corresponding SpringLocalOneType = 3.

VecY

Each value in this array is the Y-axis or area object local 2-axis component (depending on the CSys specified) of the user specified direction vector for the spring local 1-axis. The direction vector is in the coordinate system specified by the CSys item. This item applies only when the corresponding SpringLocalOneType = 3.

VecZ

Each value in this array is the X-axis or area object local 3-axis component (depending on the CSys specified) of the user specified direction vector for the spring local 1-axis. The direction vector is in the coordinate system specified by the CSys item. This item applies only when the corresponding SpringLocalOneType = 3.

CSys

Each value in this array is Local (meaning the area object local coordinate system) or the name of a defined coordinate system. This item is the coordinate system in which the user specified direction vector, Vec, is specified. This item applies only when the corresponding SpringLocalOneType = 3.

Ang

Each value in this array is the angle that the link local 2-axis is rotated from its default orientation. This item applies only when the corresponding MyType = 2. [deg]

Remarks

This function retrieves the spring assignments to an area object face.

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

VBA Example

Sub GetAreaObjectSprings()
   'dimension variables
      Dim SapObject As Sap2000.SapObject
      Dim SapModel As cSapModel
      Dim ret As Long
      Dim Vec() As Double
      Dim NumberSprings As Long
      Dim MyType() As Long
      Dim s() As Double
      Dim SimpleSpringType() As Long
      Dim LinkProp() As String
      Dim Face() As Long
      Dim SpringLocalOneType() As Long
      Dim Dir() As Long
      Dim Outward() As Boolean
      Dim VecX() As Double
      Dim VecY() As Double
      Dim VecZ() As Double
      Dim CSys() As String
      Dim Ang() As Double

   '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.NewWall(2, 48, 2, 48)

   'assign springs to area objects
      ReDim Vec(2)
      ret = SapModel.AreaObj.SetSpring("ALL", 1, 1, 1, "", -1, 1, 3, True, Vec, 0, False, "Local", Group)

   'get spring assignments to area objects
      ret = SapModel.AreaObj.GetSpring("1", NumberSprings, MyType, s, SimpleSpringType, LinkProp, Face, SpringLocalOneType, Dir, Outward, VecX, VecY, VecZ, CSys, Ang)

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

Release Notes

Initial release in version 11.00.

See Also

SetSpring

DeleteSpring

Return to SAP2000 Index


Your Ad Here