With ThisWorkbook.
Worksheets("Results")
' Results headers
.Range("A1:G1").Value = Array("Node ID", "Dx", "Dy", "Dz", "Rx",
"Ry", "Rz")
.Range("I1:N1").Value = Array("Member ID", "Axial", "Shear Y", "Shear
Z", "Moment Y", "Moment Z", "Torsion")
End With
End Sub
' Add a node to the structure
Sub AddNode(NodeID As Integer, X As Double, Y As Double, Z As Double)
Dim newNode As New clsNode
newNode.Initialize NodeID, X, Y, Z
NodeList.Add newNode
' Add to data sheet
Dim lastRow As Long
With ThisWorkbook.Worksheets("Data")
lastRow = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
.Cells(lastRow, 1).Value = NodeID
.Cells(lastRow, 2).Value = X
.Cells(lastRow, 3).Value = Y
.Cells(lastRow, 4).Value = Z
End With
End Sub
' Add a member to the structure
Sub AddMember(MemberID As Integer, StartNode As Integer, EndNode As Integer,
MaterialID As Integer)
Dim newMember As New clsMember
newMember.Initialize MemberID, StartNode, EndNode, MaterialID
MemberList.Add newMember
' Add to data sheet
Dim lastRow As Long
With ThisWorkbook.Worksheets("Data")
lastRow = .Cells(.Rows.Count, "F").End(xlUp).Row + 1
.Cells(lastRow, 6).Value = MemberID
.Cells(lastRow, 7).Value = StartNode
.Cells(lastRow, 8).Value = EndNode
.Cells(lastRow, 9).Value = MaterialID
End With
End Sub
' Add a support condition
Sub AddSupport(NodeID As Integer, Fx As Boolean, Fy As Boolean, Fz As
Boolean, _
Mx As Boolean, My As Boolean, Mz As Boolean)
Dim newSupport As New clsSupport
newSupport.Initialize NodeID, Fx, Fy, Fz, Mx, My, Mz
SupportList.Add newSupport
' Add to data sheet
Dim lastRow As Long
With ThisWorkbook.Worksheets("Data")
lastRow = .Cells(.Rows.Count, "K").End(xlUp).Row + 1
P a g e 2 | 57