Add Task Pane View Example (VB.NET)
This example shows how to add a tab to the Task Pane.
'---------------------------------------------------------------------------
' Preconditions: Verify that the bitmap file exists.
'
' Postconditions:
' 1. Displays a tab with the specified bitmap on the Task Pane.
' 2. Examine the Task Pane.
'---------------------------------------------------------------------------
Imports SolidWorks.Interop.sldworks
Imports SolidWorks.Interop.swconst
Imports System.Runtime.InteropServices
Imports System
Partial Class SolidWorksMacro
Dim ctrl As TaskpaneView
Dim bitmap(0) As String
Dim toolTip As String
Sub main()
bitmap(0) = "C:\Users\Public\Documents\SOLIDWORKS\SOLIDWORKS
2018\samples\tutorial\api\addin\pm_extruded_block.bmp"
toolTip = "Extruded block tab"
ctrl = swApp.CreateTaskpaneView3(bitmap, toolTip)
End Sub
''' <summary>
''' The SldWorks swApp variable is pre-assigned for you.
''' </summary>
Public swApp As SldWorks
End Class