GetAtticValuesByAtticSqFt(3000,90,90)
Private Sub GetAtticValuesByAtticSqFt(ByVal asf As Double, ByVal ventedEaveLF As Double, ByVal ridgeLF As Double)
CalcAtticVent((asf / 300) * 144, ventedEaveLF, ridgeLF)
Private Sub CalcAtticVent(ByVal nfa As Double, ByVal ventedEaveLF As Double, ByVal ridgeLF As Double)
Dim eave As Double = nfa / (ventedEaveLF * 12)
Dim ridgeopen As Double = ExcelFloor(nfa / (ridgeLF * 12), 0.25)
Dim RidgeOpening = ridgeopen
Dim SystemThickness = ExcelCeiling(eave * 2, 1 / 16)
Dim ReqSqrINetFreeAtEave = nfa / ventedEaveLF
Dim ReqSqrINetFreeAtRidge = nfa / ridgeLF
Dim RequiredNFAperSquareInch = nfa
Console.WriteLine("RidgeOpening: " & RidgeOpening)
Console.WriteLine("SystemThickness: " & SystemThickness)
Console.WriteLine("ReqSqrINetFreeAtEave: " & ReqSqrINetFreeAtEave)
Console.WriteLine("ReqSqrINetFreeAtRidge: " & ReqSqrINetFreeAtRidge)
Console.WriteLine("RequiredNFAperSquareInch: " & RequiredNFAperSquareInch)
Private Function ExcelFloor(ByVal number As Decimal, ByVal significance As Decimal) As Decimal
If number >= 0 And significance >= 0 Then
Return number - (number Mod significance)
Throw New Exception("Number and significance can not be negative.")
Private Function ExcelCeiling(ByVal number As Decimal, ByVal significance As Decimal) As Decimal
If number >= 0 And significance >= 0 Then
Return number + significance - (number Mod significance)
Throw New Exception("Number and significance can not be negative.")