ObjOPENSTAAD.Load.AddElementTrapPressure code format and variable types?

Hi, 

The OpenSTAAD line in the code below is not working properly and the reference guide does not seem to clarify the requirements. The line has 4 inputs stated then uses 5 inputs in the example. Please can you clarify the issue? 

Dim GlobalX As Long
Dim GlobalY As Long
Dim VaryInX As Long
Dim VaryInY As Long


GlobalX = 1
GlobalY = 2

VaryInX = 1
VaryInY = 2

For j = 0 To UBound(Plate_Array_Index(), 2)
k = 0
If Plate_Array_Index(0, j) <> 0 Then
For i = 0 To UBound(Plate_Array_Index(), 1)
If Plate_Array_Index(i, j) <> 0 Then
ReDim Preserve PlateList(k)
PlateList(k) = Plate_Array_Index(i, j)
k = k + 1
Else
End If
Next i

ObjOPENSTAAD.Load.AddElementTrapPressure PlateList(), GlobalY, VaryInY, CDbl(-2), CDbl(-5)
Else
End If

Next j

  • Can you please use function AddElementTrapPressureEx?

    Sample VBA syntax is given below:

    Set objOpenStaad = GetObject(, "StaadPro.OpenSTAAD")
    Dim nLCNum As Long
    nLCNum = 1
    objOpenStaad.Load.SetLoadActive nLCNum


    Dim plateArray(0) As Long
    plateArray(0) = 13 'PLATE NUMBER ID


    Dim direction As Long
    direction = 3 'LOAD VARYING DIRECTION; 1=X; 2=Y; 3=JOINT


    Dim loadDirection As Long
    loadDirection = 3 'DIRECTION OF PRESSURE; 0=LOCAL Z; 1=GX; 2=GY; 3=GZ


    Dim startPre As Double
    startPre = 2 'Pressure at loading starting point.(Node1 when JOINT is selected)
    Dim endPre As Double
    endPre = 5 'Pressure at loading ending point.(Node2 when JOINT is selected)
    Dim pre3 As Double
    pre3 = 2.6 'Pressure at loading point.(applicable only when JOINT is selected)
    Dim pre4 As Double
    pre4 = 1 'Pressure at loading point.(applicable only when JOINT is selected)

    objOpenStaad.Load.AddElementTrapPressureEx plateArray, direction, loadDirection, startPre, endPre, pre3, pre4