"θz = " & Format(theta, "0.
000E+00") & "
rad" & vbCrLf
Next nodeId
results = results & vbCrLf & "Reactions:" & vbCrLf
For nodeId = 1 To nodes.Count
On Error Resume Next
Dim s As Support
Set s = supports("S" & nodeId)
If Not s Is Nothing Then
Dim rx As Double, ry As Double, mz As Double
rx = reactions(3 * (nodeId - 1) + 1)
ry = reactions(3 * (nodeId - 1) + 2)
mz = reactions(3 * (nodeId - 1) + 3)
results = results & "Node " & nodeId & ": Rx = " & Format(rx,
"0.00") & " N, " & _
"Ry = " & Format(ry, "0.00") & " N, "
& _
"Mz = " & Format(mz, "0.00") & " Nm" &
vbCrLf
End If
On Error GoTo 0
Next nodeId
' Show results in a message box (might be too large - consider writing to
worksheet)
MsgBox results, vbInformation, "Analysis Results"
' Visualize deformed shape
Dim deformed_nodes As Collection
Set deformed_nodes = New Collection
Dim scale_factor As Double
scale_factor = 50 ' Adjust as needed for visualization
For nodeId = 1 To nodes.Count
Dim original_node As Node
Set original_node = nodes("N" & nodeId)
Dim deformed_node As Node
deformed_node.x = original_node.x + scale_factor * U(3 * (nodeId - 1)
+ 1)
deformed_node.y = original_node.y + scale_factor * U(3 * (nodeId - 1)
+ 2)
deformed_nodes.Add deformed_node, "N" & nodeId
Next nodeId
' Update display with deformed shape
' Note: In a full implementation, you'd update the drawing to show both
original and deformed shapes
MsgBox "Analysis complete. Deformed shape visualized with scale factor "
& scale_factor & ".", vbInformation
End Sub
P a g e 48 | 62