RAM DataAccess - Frame Reactions

I am looking to create a Microsoft Excel Spreadsheet that pulls reactions out of RAM Frame using DataAccess and Visual Basic for Applications (VBA).  Is there a sample VBA project or other guidance anywhere in the forums with code to read the lateral reactions (Major and Minor axis - shear, moment, and axial loads) for each load combination for a beam, a column, and a wall?  With that, I would be able to manipulate this information within VBA as needed.  

I am kind of new to programming with DataAccess and the 451 page Developer's Guide is a lot to wrap my head around.  Any other resources/spreadsheets for DataAccess that anyone could suggest would also be greatly appreciated.  Thank you!

Parents
  • This might be too much to cover in a forum post. If my comments below are not helpful, please submit a service request and mention this post.

    Reactions in RAM Frame are nodal reactions at the base of the structure. Based on your comments, it appears that you want the member forces at the ends of a member. Those can be found using the GetMemberForces method in the IForces2 interface.

    Load combination forces are not available directly. Below is a snippet of code that shows how that can be accomplished. Please note, the code below uses the GetLatBeamForcesLeftAt method, not the GetMemberForces method noted above. Declaration of variables have been omitted for clarity.

    'Initialize Interfaces
    Set IForces = RAMDataAcc1.GetDispInterfacePointerByEnum(IForces_INT)
    Set ILoading1 = RAMDataAcc1.GetDispInterfacePointerByEnum(ILoading_INT)
    ILoading1.GetNumAnalyzedFrameLoadCases lNumCases
    Set ILoadCombinations = IModel.GetLoadCombinations(eComboType)

    'for each combo
    For i = 0 To ILoadCombinations.GetCount - 1
    Set ILoadCombination = ILoadCombinations.GetAt(i)
    dAxialCombo = 0
    dMajMomentCombo = 0
    dMinMomentCombo = 0
    dMajShearCombo = 0
    dMinShearCombo = 0
    dTorsionCombo = 0
    Set ILoadCombinationTerms = ILoadCombination.GetLoadCombinationTerms

    'for each term
    For j = 0 To ILoadCombinationTerms.GetCount - 1
    Set ILoadCombinationTerm = ILoadCombinationTerms.GetAt(j)
    Set ILoadCases = IModel.GetLoadCases(RAMFrameResultType)
    Set ILoadCase = ILoadCases.Get(ILoadCombinationTerm.lLoadCaseID)
    IForces.GetLatBeamForcesLeftAt lUID, ILoadCase.lAnalyzeNo, dLoc, dAxial, dMajMoment, dMinMoment, dMajShear, dMinShear, dTorsion
    dAxialCombo = dAxialCombo + ILoadCombinationTerm.dFactor * dAxial
    dMajMomentCombo = dMajMomentCombo + ILoadCombinationTerm.dFactor * dMajMoment
    dMinMomentCombo = dMinMomentCombo + ILoadCombinationTerm.dFactor * dMinMoment
    dMajShearCombo = dMajShearCombo + ILoadCombinationTerm.dFactor * dMajShear
    dMinShearCombo = dMinShearCombo + ILoadCombinationTerm.dFactor * dMinShear
    dTorsionCombo = dTorsionCombo + ILoadCombinationTerm.dFactor * dTorsion
    Next

    'print forces
    Cells(lRow, 1) = ILoadCombination.lLabelNo
    Cells(lRow, 2) = dLoc
    Cells(lRow, 3) = dAxialCombo
    Cells(lRow, 4) = dMajMomentCombo / 12
    Cells(lRow, 5) = dMinMomentCombo / 12
    Cells(lRow, 6) = dMajShearCombo
    Cells(lRow, 7) = dMinShearCombo
    Cells(lRow, 8) = dTorsionCombo / 12
    lRow = lRow + 1

    Next



    Answer Verified By: Tom Curry 

  • Hi Eric,

    I've tried to build a excel spreadsheet to extract member force from analysed RAM SS model and found your code. But I get an error in IForces.GetLatBeamForcesLeftAt with the notification as image below. Do you have any idea about this? Thanks a lot.

      Khanh_Testing.xls

Reply Children
  • You are passing in a couple of incorrect arguments.  The DataAccess manual installs with the program in the manuals folder.  The installation location is typically here:

    C:\Program Files\Bentley\Engineering\RAM Structural System\manuals

    1.  The method takes a beam unique ID (always ends in 02 for a beam), but  you appear to be passing in a beam label (member number you see in Modeler). 

    2.  The method takes a load case index from the list of analyzed cases, but you are passing in a load case unique ID.

    Also, I recommend that you include the Option Explicit declaration and declare all variables with the data type the DataAccess methods expect.  Undeclared variables in VBA default to a variant data type.  Many DataAccess methods will fail if you attempt to pass in a variant rather than the expected data type.