6.3.2. Check your Script to add Blocks Automatically

Sub OnMouseUp(x As Long, y As Long, flags As Long)

Dim itemid As String

Dim model As String

Dim item As New prtItem

  

For i = 1 To 10

'Prompt user for item ID and model

'itemid=InputBox$("Enter BLOCK item ID, please","Item ID Entry","")

'model=InputBox$("Enter BLOCK model type, please (valid entries: 25,36,60,99)","Model Type Entry","")

 

'Random generate item ID and model type

Randomize

Number = Random(1,5000)

itemid="B" & Number

If(number Mod 4)=0 Then

model="25"

ElseIf(number Mod 4)=1 Then

model="36"

ElseIf(number Mod 4)=2 Then

model="60"

Else

model="99"

End If

 

'Set the item properties

Item.regionid="SCHEDULE"

item.itemid=itemid

item.itemtypeid=model

item.regionloc=-1

item.exthold 0

item.groupid="MAIN"

item.inthold 0

'Add the item to PRT

item.Add

Next i

End Sub

More information