Open STAAD Command GetRepeatLoadCount not working

I am struggling with this Openstaad command GetRepeatLoadCount. For some reason, it is not working for me. It returns value 1 instead of the actual count. 

Parents Reply Children
  • There is no direct OpenSTAAD function to get the Total repeat Load count in a model as the Repeat Load is treated as Load item like any other load items(Nodal load, member load) defined under a primary load case. But you can use combination of OpenSTAAD functions to get the count.

    Sample VBA code:

    Set objOpenStaad = GetObject(, "StaadPro.OpenSTAAD")
    Dim nPrimaryLoadCase As Long
    Dim LC() As Long
    Dim LoadType As Long
    Dim nLoadSize As Long
    nLoadSize = 0
    LoadType = 4201 ''Repeat load data
    Dim RepeatLoadCount As Long
    RepeatLoadCount = 0
    Dim RepeatLCNo As Long

    nPrimaryLoadCase = objOpenStaad.Load.GetPrimaryLoadCaseCount
    ReDim LC(nPrimaryLoadCase - 1)
    objOpenStaad.Load.GetPrimaryLoadCaseNumbers LC

    For i = 0 To nPrimaryLoadCase - 1
    objOpenStaad.Load.SetLoadActive LC(i)

    nLoadSize = objOpenStaad.Load.GetLoadTypeCount(LoadType)
    If nLoadSize > 0 Then
    RepeatLoadCount = RepeatLoadCount + 1
    RepeatLCNo = LC(i)
    End If
    Next i
    MsgBox "Repeat Load count is: " & RepeatLoadCount

    Answer Verified By: Desh Raj Singh