Since our add-ins for RS 3.2 were written by VB, we plan to use VB.net as the developement tool. I wrote some codes to imitate the C# code. However, I do not see any add-in in RS 5.0. It would be greatly appreciated if anyone could help me fix the bug.
Imports System
Imports ABB.Robotics.RobotStudio
Imports ABB.Robotics.RobotStudio.Environment
Imports ABB.Robotics.RobotStudio.Stations
Imports System.Windows.Forms
Namespace MyAddinVB
Public Class MyAddinVB
‘’'
Public Sub New()
End Sub
'*********************************************************** *
’ This method is called when RS starts
Public Sub AddinMain()
’ Create a new command button
Dim Buttonfiltered= New CommandBarButton(“HelloMyAddinVB”, “Hello MyAddin VB!”)
’ Add the button to the “Tools” menu
’ The IDs of predefined menus and commands are found in “RobotStudioIDSummary.html”
’
CommandBarPopup.FromID(“MenuTools”).Controls.Add(Butto n)
’ Connect the command events
’ C# Code
'Button.UpdateCommandUI += New UpdateCommandUIEventHandler(button_UpdateCommandUI)
'Button.ExecuteCommand += New ExecuteCommandEventHandler(button_ExecuteCommand)
'VB Code
AddHandler Button.UpdateCommandUI, AddressOf button_UpdateCommandUI
AddHandler Button.ExecuteCommand, AddressOf button_ExecuteCommand
End Sub
Public Sub button_UpdateCommandUI(ByVal sender As Object, ByVal e As UpdateCommandUIEventArgs)
’ // Enable the button
e.Enabled = True
End Sub
Public Sub button_ExecuteCommand(ByVal sender As Object, ByVal e As ExecuteCommandEventArgs)
’ // Do something
MessageBox.Show(“Hello MyAddin VB!”)
End Sub
'*********************************************************** ****************
End Class
End Namespace