i would like to use DataAccess to pull nodal reactions from a Ram Frame model. I don't see any documented way to do this. What commands are there to accomplish this?
From the IModel interface, call GetFrameAnalysisNodes to set an INodes interface. Filter the INodes interface for foundation nodes. Then, call the GetAt or GetClosestNode method to set the INode interface for a particular node. The INode interface has a GetReactions method that returns a MemberForces interface. Finally, use the Get or GetAt methods to set the IMemberForce interface for a particular load case.
Answer Verified By: CBGoings
In case anyone else needs it, here is VBA code I put together to accomplish reading reactions from the RAM model (the RAMInitializeDA is another function to open model etc., but not included here):
Function RAMGetReactionDA(dbname As String, x_coord As Double, y_coord As Double, z_coord As Double, loadcase As String, FX_FY_FZ_MX_MY_or_MZ As String)'' function uses the RAM Data Access routines to read the nodal reactions from frame nodes in a RAM model''From the IModel interface, call GetFrameAnalysisNodes to set an INodes interface.'Filter the INodes interface for foundation nodes.'Then, call the GetAt or GetClosestNode method to set the INode interface for a particular node.'The INode interface has a GetReactions method that returns a IMemberForces interface.'Finally, use the Get or GetAt methods to set the IMemberForce interface for a particular load case.
Dim rtrnerr As Integer
' data access dims '**************************************** 'Defining DA variables used in this function '**************************************** Dim lStatus As Long ' function dims Dim coordinatetollerance As Double Dim label, size As String Dim nodelist As INodes Dim reactionnodes As INodes Dim requestednode As INode Dim nodecoordinate As SCoordinate Dim memberforces As IMemberForces Dim memberforce As IMemberForce Dim loadcasenum As Long Dim nodecount As Long Dim i As Long Dim found As Boolean Dim dx As Double Dim dy As Double Dim dz As Double Dim memberforcescount As Long Dim loacasenum As Long coordinatetollerance = 1 rtrnerr = 0 '''''''''' 'Open model rtrnerr = RAMInitializeDA(dbname)
If rtrnerr > 0 Then RAMGetReactionDA = initializedberror Else '''''''''' 'Getting Model info Set RAMDataAccIModel = RAMDataAcc.GetDispInterfacePointerByEnum(IModel_INT) ' getting lateral nodes Set nodelist = RAMDataAccIModel.GetFrameAnalysisNodes() ' getting reaction nodes nodelist.Filter eRNFilterAtFoundation, 1 ' I'm not sure what second argument is, nothing is specified in documentation nodecount = nodelist.GetCount() ' finding node with requested coordinates i = 0 found = False While Not found And i < nodecount Set requestednode = nodelist.GetAt(i) ' zero based nodecoordinate = requestednode.sLocation dx = Abs(nodecoordinate.dXLoc - x_coord) dy = Abs(nodecoordinate.dYLoc - y_coord) dz = Abs(nodecoordinate.dZLoc - z_coord) If dx < coordinatetollerance And dy < coordinatetollerance And dz < coordinatetollerance Then found = True End If i = i + 1 Wend loadcasenum = GetLatLoadCaseNumber(loadcase) ' determining reactions If found And loadcasenum >= 0 Then Set memberforces = requestednode.GetReactions memberforcescount = memberforces.GetCount() If loadcasenum < memberforcescount Then Set memberforce = memberforces.GetAt(loadcasenum) RAMGetReactionDA = Switch(UCase(FX_FY_FZ_MX_MY_or_MZ) = "FX", memberforce.dShearMajor, _ UCase(FX_FY_FZ_MX_MY_or_MZ) = "FY", memberforce.dShearMinor, _ UCase(FX_FY_FZ_MX_MY_or_MZ) = "FZ", memberforce.dAxial, _ UCase(FX_FY_FZ_MX_MY_or_MZ) = "MXX", memberforce.dMomentMajor, _ UCase(FX_FY_FZ_MX_MY_or_MZ) = "MYY", memberforce.dMomentMinor, _ UCase(FX_FY_FZ_MX_MY_or_MZ) = "MZZ", memberforce.dTorsion) If IsNull(RAMGetReactionDA) Then RAMGetReactionDA = "Valid components are: RX, RY, RZ, MXX, MYY, MZZ" End If Else RAMGetReactionDA = "Load case not found for node" End If Else RAMGetReactionDA = "Node not found" If loacasenum < 0 Then RAMGetReactionDA = "Load case not found" End If End IfEnd Function