To get the maximum and minimum bending moment in a beam i wrote a code as follows:
Private Sub CommandButton2_Click()Dim OpenSTAAD As ObjectSet objOpenSTAAD = GetObject(, "StaadPro.OpenSTAAD")Dim lMemberNo As LongDim lEnd As LongDim lLoadcase As LongDim dForceArray(6) As DoubleDim NOM As IntegerDim NOLC As IntegerDim sDir As StringDim Dmin As DoubleDim Dminpos As DoubleDim Dmax As DoubleDim Dmaxpos As DoubleDim dlength As LongDim lForceArray(6) As DoubleNOLC1 = Cells(1, 2)NOLC2 = Cells(1, 3)NOM = Cells(1, 1)sDir = MzFor i = 1 To NOM lMemberNo = Cells(2 + i, 1) Cells(4 + (i - 1) * NOLC1, 23) = lMemberNoNext i'ULSFor i = 1 To NOM For j = 1 To NOLC1 lLoadcase = Cells(2 + j, 2) Cells(3 + j + (i - 1) * NOLC1, 25) = lLoadcase Next jNext iFor i = 1 To NOM lMemberNo = Cells(2 + i, 1) For j = 1 To NOLC1 lLoadcase = Cells(2 + j, 2) objOpenSTAAD.Output.GetIntermediateMemberForcesAtDistance lMemberNo, 0.642, lLoadcase, lForceArray Cells((3 + j) + (i - 1) * NOLC1, 24) = lForceArray(5) Next j For j = 1 To NOLC1 lLoadcase = Cells(2 + j, 2) objOpenSTAAD.Output.GetMinMaxBendingMoment lMemberNo, sDir, lLoadcase, Dmin, Dminpos, Dmax, Dmaxpos Cells((3 + j) + (i - 1) * NOLC1, 27) = Dmax Next jNext iSet objOpenSTAAD = NothingEnd Sub
But I'm getting the very small values (E-206) for Maximum moments.
Can anyone point out the error in the above code...!