Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
bbrumfield
277 Views, 2 Replies

Run multiple array lists with ability to skip to next

I have several array lists that do function as long as you make a selection. If you skip there is a failure message that says :

"Error in rule: Stock Sheet Material Stock Code List, in document: CadTalk_Test_3.ipt

Index was outside the bounds of the array."

 

As an example, I'd like to skip past Aluminum and select Galvanized or Steel etc. Which ever material in this case that is selected should create a custom property named "material stock code 1"

 

Dim oDoc As Document = ThisDoc.Document

Dim CustTypeALU As New ArrayList
CustTypeALU.Add(".063, Sheet, Aluminum, 5052-H32, 60.00 x 120.00 | ME-CRS-0003")
CustTypeALU.Add(".125, Sheet, Aluminum, 5052-H32, 60.00 x 120.00 | ME-CRS-0005")
CustTypeALU.Add(".090, Sheet, Aluminum, 5052-H32, 60.00 x 120.00 | ME-CRS-0007")
CustTypeALU.Add(".190, Sheet, Aluminum, 5052-H32, 60.00 x 120.00 | ME-CRS-0009")
CustTypeALU.Add(".050, Sheet, Aluminum, 5052-H32, 60.00 x 120.00 | ME-CRS-0013")
CustTypeALU.Add(".030, Sheet, Aluminum, 5052-H32, 60.00 x 120.00 | ME-CRS-0016")
CustTypeALU.Add(".080, Sheet, Aluminum, 5052-H32, 60.00 x 120.00 | ME-CRS-0017")

Dim oSelSheetMaterialStockCodeOpt1 As String = InputListBox("Select Sheet Material Stock Code", 
	CustTypeALU, oSheetMaterialStockCodeOpt1, Title := "ALU Sheet Selection", _
	ListName := "ALU Sheet Stock Code")

sSplit = Split(oSelSheetMaterialStockCodeOpt1, "|")
oDesc = sSplit(0) 
oPN = sSplit(1) 

'if this custom property doesn't exist, this next line will also create it if needed (no error shown)
iProperties.Value("Custom", "Material Stock Code 1") = oPN

MsgBox(iProperties.Value("Custom", "Material Stock Code 1") )

Dim CustTypeGALV As New ArrayList
CustTypeGALV.Add("16GA, Sheet, Galvanneal Steel, 60.00 x 120.00 | ME-GALN-0001")
CustTypeGALV.Add("18GA, Sheet, Galvanneal Steel, 60.00 x 120.00 | ME-GALN-0002")
CustTypeGALV.Add("22GA, Sheet, Galvanneal Steel, 60.00 x 120.00 | ME-GALN-0003")
CustTypeGALV.Add("14GA, Sheet, Galvanized Steel, 60.00 x 120.00 | ME-GALV-0001")
CustTypeGALV.Add("16GA, Sheet, Galvanized Steel, 60.00 x 120.00 | ME-GALV-0002")
CustTypeGALV.Add("18GA, Sheet, Galvanized Steel, 60.00 x 120.00 | ME-GALV-0003")
CustTypeGALV.Add("24GA, Sheet, Galvanized Steel, 60.00 x 120.00 | ME-GALV-0004")

Dim oSelSheetMaterialStockCodeOpt2 As String = InputListBox("Select Sheet Material Stock Code", 
	CustTypeGALV, oSheetMaterialStockCodeOpt2, Title := "GALV Sheet Selection", _
	ListName := "GALV Sheet Stock Code")

sSplit = Split(oSelSheetMaterialStockCodeOpt2, "|")
oDesc = sSplit(0) 
oPN = sSplit(1) 

'if this custom property doesn't exist, this next line will also create it if needed (no error shown)
iProperties.Value("Custom", "Material Stock Code 1") = oPN

MsgBox(iProperties.Value("Custom", "Material Stock Code 1") )

Brent

 

Tags (1)