The document outlines a function for validating input data by checking if support and load references correspond to valid nodes. It also includes procedures for adding load cases and loads to those cases, updating a data sheet accordingly. The validation function returns a boolean indicating whether all checks have passed or not.
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 ratings0% found this document useful (0 votes)
3 views1 page
Grasp
The document outlines a function for validating input data by checking if support and load references correspond to valid nodes. It also includes procedures for adding load cases and loads to those cases, updating a data sheet accordingly. The validation function returns a boolean indicating whether all checks have passed or not.
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
MsgBox "Support references invalid node " & sup.
NodeID, vbExclamation, "GRASP Error" ValidateInputData = False Exit Function End If Next sup
' Check loads
Dim ld As clsLoad For Each ld In LoadList If Not NodeExists(ld.NodeID) Then MsgBox "Load references invalid node " & ld.NodeID, vbExclamation, "GRASP Error" ValidateInputData = False Exit Function End If Next ld
' If we get here, all checks passed
ValidateInputData = True End Function
Private Function NodeExists(nodeID As Integer) As Boolean
On Error Resume Next Dim node As clsNode Set node = NodeList(nodeID) NodeExists = Not node Is Nothing End Function
'## 5. Load Combinations and Design Checks ##################################
Sub AddLoadCase(LCID As Integer, Description As String)
Dim lc As New clsLoadCase lc.Initialize LCID, Description LoadCaseList.Add lc, CStr(LCID)
' Add to data sheet
Dim lastRow As Long With ThisWorkbook.Worksheets("Load Cases") lastRow = .Cells(.Rows.Count, "A").End(xlUp).Row + 1 .Cells(lastRow, 1).Value = LCID .Cells(lastRow, 2).Value = Description End With End Sub
Sub AddLoadToCase(LCID As Integer, LoadID As Integer, Factor As Double)
Dim lc As clsLoadCase Set lc = LoadCaseList(LCID)
lc.AddLoad LoadID, Factor
' Add to data sheet
Dim lastRow As Long With ThisWorkbook.Worksheets("Load Cases") lastRow = .Cells(.Rows.Count, "D").End(xlUp).Row + 1 .Cells(lastRow, 4).Value = LCID .Cells(lastRow, 5).Value = LoadID