Add Task Pane View Example (C#)
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.
//---------------------------------------------------------------------------
using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;
using System.Runtime.InteropServices;
using System;
namespace AddTaskPaneView_CSharp.csproj
{
public partial class SolidWorksMacro
{
public void Main()
{
TaskpaneView ctrl;
string[] bitmap = new string[1];
string toolTip;
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);
}
/// <summary>
/// The SldWorks swApp variable is pre-assigned for you.
/// </summary>
public SldWorks swApp;
}
}