Hello everyone,
I've got an excel code that extracts support reactions on a given node. I've been using it and it works well with the old StaadPro Select series. But since after I've migrated to Connect Edition, the codes has stopped working and giving me errors. Can someone check which commands needs to be replaced? Highlighted in red below is what it shows when I try to debug the command.
Private Sub CommandButton1_Click()Dim NoOfNodes As IntegerDim NoOfLCs As IntegerDim nodes() As LongDim LC() As LongDim reactionArray(6) As DoubleNoOfNodes = Cells(2, 1)NoOfLCs = Cells(2, 2)ReDim nodes(1 To NoOfNodes)ReDim LC(1 To NoOfLCs)For i = 1 To NoOfNodes nodes(i) = Cells(3 + i, 1)Next iFor i = 1 To NoOfLCs LC(i) = Cells(3 + i, 2)Next iSet objOpenSTAAD = GetObject(, "StaadPro.OpenSTAAD")For i = 1 To NoOfNodes For j = 1 To NoOfLCs Cells(4 + j + (i - 1) * NoOfLCs, 6) = nodes(i) Cells(4 + j + (i - 1) * NoOfLCs, 7) = LC(j) objOpenSTAAD.Output.GetSupportReactions nodes(i), LC(j), reactionArray For k = 1 To 6 Cells(4 + j + (i - 1) * NoOfLCs, 7 + k) = reactionArray(k - 1) Next k Next jNext i
Set objOpenSTAAD = NothingEnd Sub
And also for getting selected nodes.
Private Sub CommandButton3_Click()Dim numno As LongDim node() As LongDim i As Integer
Set objOpenSTAAD = GetObject(, "STAADPro.OpenSTAAD")numno = objOpenSTAAD.Geometry.GetNoOfSelectedNodesCells(1, 1).Value = numno
ReDim node(numno - 1) As LongFor i = 1 To numnoobjOpenSTAAD.Geometry.GetSelectedNodes node, 0Cells(3 + i, 1).Value = node(i - 1)Next
Set objOpenSTAAD = Nothing
End Sub
Please attach the macro and the .STD file
I don't have a macro. It is written in excel VBA. Find attached.Support Reaction Extractor.xlsm
It doesn't have to be a particular STAAD file. It used to work with any STAAD file. All I had to do was click buttons.
How this Macro file identifies the exact model,from where it has to extract the reactions ?Can u pl define the procedure ?
It takes results from whatever STAAD file is opened. Therefore, you can have ONLY 1 STAAD file running in the same time. It also requires that the analysis is already complete before running the commands in the excel file.
1) Run Analysis.
2) Select/Type in supports nodes you want to extract reactions from
3) Run command.
This was the procedure with StaadPro Select Series. But since after I updated to Connect Edition, it does not work anymore.