我正在使用Autodesk Inventor和Visual Basic,我试图在一个框中显示一个值。除一个以外,所有值都显示。值fractionDisplay(thicknessDisplay)在框中保持显示3/16(这是我的fractionDisplay()数组中的第一个值)。为什么不显示基于thicknessDisplay数设置为除0以外的任何值的其他值?
这是我的代码:
Dim erpNumber() As String = {"PA0001", "PA0002", "PA0003", "PA0004", "PA0006", "PC0003", "PC0004", "PC0005", "PC0006", "PC0007", "PC0008", "PC0009", "PC0010", "PC0011"}
Dim fractionDisplay() As String = {"3/16", "1/4", "5/16", "3/8", "1/8", "1/2", "5/8", "3/4", "1", "1 1/4", "1 1/2", "2", "2 1/2", "3"}
stockNumberValue = erpNumber(plateThickness)
iProperties.Value("Project", "Description") = fractionDisplay(thicknessDisplay) & """" & " X " & Length & """" & " X " & Width & """" & " 100XF BURNOUT"
If Thickness = 0.1875 Then
plateThickness = 0
thicknessDisplay = 0
ElseIf Thickness = 0.25 Then
plateThickness = 1
thicknessDisplay = 1
ElseIf Thickness = 0.3125 Then
plateThickness = 2
thicknessDisplay = 2
ElseIf Thickness = 0.375 Then
plateThickness = 3
thicknessDisplay = 3
ElseIf Thickness = 0.125 Then
plateThickness = 4
thicknessDisplay = 4
ElseIf Thickness = 0.5 Then
plateThickness = 5
thicknessDisplay = 5
ElseIf Thickness = 0.625 Then
plateThickness = 6
thicknessDisplay = 6
ElseIf Thickness = 0.75 Then
plateThickness = 7
thicknessDisplay = 7
ElseIf Thickness = 1 Then
plateThickness = 8
thicknessDisplay = 8
ElseIf Thickness = 1.25 Then
plateThickness = 9
thicknessDisplay = 9
ElseIf Thickness = 1.5 Then
plateThickness = 10
thicknessDisplay = 10
ElseIf Thickness = 2 Then
plateThickness = 11
thicknessDisplay = 11
ElseIf Thickness = 2.5 Then
plateThickness = 12
thicknessDisplay = 12
ElseIf Thickness = 3 Then
plateThickness = 13
thicknessDisplay = 13
End If
stockNumberValue = erpNumber(plateThickness)
iProperties.Value("Project", "Stock Number") = stockNumberValue
以下是用户输入的结果,例如.5:
股票编号:PC0003
描述:3/16“X 12”X 5“100XF BURNOUT
应该说1/2“X 12”X 5“100XF BURNOUT
答案 0 :(得分:1)
在您阅读阵列时,您还没有设置thicknessDisplay。
iProperties.Value("Project", "Description") = fractionDisplay(thicknessDisplay) & """" & " X " & Length & """" & " X " & Width & """" & " 100XF BURNOUT"
需要在Ifs和Elseifs之后