0% found this document useful (0 votes)
10 views1 page

GRASP Python

The document outlines a VBA script that processes structural analysis results, populating a worksheet with node reactions and element forces. It formats the results into tables and includes a summary of the analysis, detailing the counts of nodes, elements, supports, and loads. The script utilizes error handling to manage potential issues during execution.

Uploaded by

Le Fondateur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

GRASP Python

The document outlines a VBA script that processes structural analysis results, populating a worksheet with node reactions and element forces. It formats the results into tables and includes a summary of the analysis, detailing the counts of nodes, elements, supports, and loads. The script utilizes error handling to manage potential issues during execution.

Uploaded by

Le Fondateur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

row = row + 1

For nodeId = 1 To [Link]


On Error Resume Next
Dim s As Support
Set s = supports("S" & nodeId)
If Not s Is Nothing Then
[Link](row, 1).Value = "N" & nodeId
[Link](row, 2).Value = reactions(3 * (nodeId - 1) + 1)
[Link](row, 3).Value = reactions(3 * (nodeId - 1) + 2)
[Link](row, 4).Value = reactions(3 * (nodeId - 1) + 3)
row = row + 1
End If
On Error GoTo 0
Next nodeId

' Format as table


[Link](xlSrcRange, [Link]("A" & row -
[Link] & ":D" & row - 1), , xlYes).Name = "Reactions"

' Write element forces


row = row + 2
[Link](row, 1).Value = "Element Forces"
row = row + 1
[Link](row, 1).Value = "Element"
[Link](row, 2).Value = "Node"
[Link](row, 3).Value = "Axial (N)"
[Link](row, 4).Value = "Shear (N)"
[Link](row, 5).Value = "Moment (Nm)"

row = row + 1
Dim elemId As Integer
For elemId = 1 To [Link]
[Link](row, 1).Value = "E" & elemId
[Link](row, 2).Value = "N" & elements("E" & elemId).node1
[Link](row, 3).Value = elementForces(elemId, 1) ' Axial
[Link](row, 4).Value = elementForces(elemId, 2) ' Shear
[Link](row, 5).Value = elementForces(elemId, 3) ' Moment
row = row + 1

[Link](row, 2).Value = "N" & elements("E" & elemId).node2


[Link](row, 3).Value = elementForces(elemId, 4)
[Link](row, 4).Value = elementForces(elemId, 5)
[Link](row, 5).Value = elementForces(elemId, 6)
row = row + 1
Next elemId

' Format as table


[Link](xlSrcRange, [Link]("A" & row - 2 *
[Link] & ":E" & row - 1), , xlYes).Name = "ElementForces"

' Add summary and formatting


[Link](1, 6).Value = "Analysis Summary"
[Link](2, 6).Value = "Nodes: " & [Link]
[Link](3, 6).Value = "Elements: " & [Link]
[Link](4, 6).Value = "Supports: " & [Link]
[Link](5, 6).Value = "Loads: " & [Link]
[Link](6, 6).Value = "Analysis Type: " & analysisType

P a g e 59 | 62

You might also like