7.3. Review the Script for the Machine Button

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

 

Dim region As New prtregion

 

Region.Id="ROBOT_CONV"

Region.GetItemList

If region.item(0).itemtypeid = "00" Then

j = 1

Else

j = 0

End If

If region.item(j).attr(1).value = "RED" Or region.item(j).attr(1).value="GREEN" Then

PointSet "X_MACHINE0",1

Else

PointSet "X_MACHINE1",1

End If

End Sub

More information