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

Grasp

The document contains VBA code for managing a structural analysis workbook, including functions to add nodes, members, and support conditions to a data sheet. It initializes headers for results and data worksheets and updates them with new entries. The code utilizes classes for nodes, members, and supports to encapsulate their properties and behaviors.

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)
3 views1 page

Grasp

The document contains VBA code for managing a structural analysis workbook, including functions to add nodes, members, and support conditions to a data sheet. It initializes headers for results and data worksheets and updates them with new entries. The code utilizes classes for nodes, members, and supports to encapsulate their properties and behaviors.

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

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy