'从PKPM钢筋标注比如"2%%13112"中分析出钢筋根数S1,级别S2,直径S3,面积S4
Function GetSteels(S As String, ByRef S1 As Integer, ByRef S2 As Integer, ByRef S3 As Integer, ByRef S4 As Long)
Dim Temp1 As Integer
Temp1 = InStr(S, "%")
S1 = Val(Left(S, Temp1 - 1))
Dim Temp2 As Integer
Temp2 = Val(Mid(S, Temp1 + 2, 3))
Select Case Temp2
Case 130
S2 = 1
Case 131
S2 = 2
Case 132
Case 3
End Select
S3 = Val(Mid(S, Temp1 + 5))
S4 = Int(S3 ^ 2 * 3.14 / 4)
End Function
Function GetSteels(S As String, ByRef S1 As Integer, ByRef S2 As Integer, ByRef S3 As Integer, ByRef S4 As Long)
Dim Temp1 As Integer
Temp1 = InStr(S, "%")
S1 = Val(Left(S, Temp1 - 1))
Dim Temp2 As Integer
Temp2 = Val(Mid(S, Temp1 + 2, 3))
Select Case Temp2
Case 130
S2 = 1
Case 131
S2 = 2
Case 132
Case 3
End Select
S3 = Val(Mid(S, Temp1 + 5))
S4 = Int(S3 ^ 2 * 3.14 / 4)
End Function
'从PKPM钢筋标注比如"2%%13112+3%%13120"中分析出钢筋面积
Function GetSteels2(S As String) As Long
Dim Temp1 As Integer
Dim Temp2 As Integer
Dim A As Long
A = 0
Temp2 = InStr(S, "+")
If Temp2 = 0 Then
Temp1 = InStr(S, "%")
A = Int(Val(Mid(S, Temp1 - 1, 1)) * Val(Mid(S, Temp1 + 5, 2)) ^ 2) * 3.14 / 4 + A
Else
Do
Temp1 = InStr(S, "%")
If Temp1 = 0 Then Exit Do
A = Int(Val(Mid(S, Temp1 - 1, 1)) * Val(Mid(S, Temp1 + 5, 2)) ^ 2) * 3.14 / 4 + A
S = Mid(S, Temp1 + 8)
Loop
End If
GetSteels2 = A
End Function
Function GetSteels2(S As String) As Long
Dim Temp1 As Integer
Dim Temp2 As Integer
Dim A As Long
A = 0
Temp2 = InStr(S, "+")
If Temp2 = 0 Then
Temp1 = InStr(S, "%")
A = Int(Val(Mid(S, Temp1 - 1, 1)) * Val(Mid(S, Temp1 + 5, 2)) ^ 2) * 3.14 / 4 + A
Else
Do
Temp1 = InStr(S, "%")
If Temp1 = 0 Then Exit Do
A = Int(Val(Mid(S, Temp1 - 1, 1)) * Val(Mid(S, Temp1 + 5, 2)) ^ 2) * 3.14 / 4 + A
S = Mid(S, Temp1 + 8)
Loop
End If
GetSteels2 = A
End Function
[本日志由 tiancao1001 于 2008-11-17 04:55 PM 编辑]
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |