Welcome
Collapse Getting StartedGetting Started
Overview
Expand Types of SOLIDWORKS API ApplicationsTypes of SOLIDWORKS API Applications
Expand SOLIDWORKS API Object Model and Class HierarchySOLIDWORKS API Object Model and Class Hierarchy
Collapse Programming with the SOLIDWORKS APIProgramming with the SOLIDWORKS API
Collapse Add-insAdd-ins
Callbacks
Icons
Shortcut Menus
Toolbars
API Dependent on SOLIDWORKS Being Visible
Arrays
Attributes Imported from ACIS SAT Files
Bitmasks
Block Definitions and Block Instances
Bodies in Body Folders
BOOL and VARIANT_BOOL
Bounding Box and Note Text
COM vs. Dispatch
CommandManager and CommandGroups
Components, Configurations, and Suppression States
Compound Note
ComVisibleAttribute in VB.NET and C# Macros and Add-ins
Controls, Visual Basic 6.0, and Windows XP
Default Paths
Drawing Views and Model Entities
Early and Late Binding
Expand EventsEvents
Features of Components
Helper Functions
Hole Wizard Features and Objects
IDispatch Object Arrays as Input in .NET
Implementation Guidelines
Import and Export File Options
In-process Methods
Instantiate ActiveX Controls as Tabs
Interface Pointers
ISafeArrayUtility Interface Overview
Keystrokes and Accelerator Keys
Library Features and Objects
Lightweight Components
Line Attributes for View::GetPolyLinesAndCurves
Line Weights
Long vs. Integer
Expand Macro FeaturesMacro Features
Manipulators
Mass Properties
Expand Multibody PartsMultibody Parts
Option Explicit Statement
Expand Packing and Unpacking Double Arrays and Integer PairsPacking and Unpacking Double Arrays and Integer Pairs
Partition Rollback and API Handles
Persistent Reference IDs
Presentation Transforms
Expand PropertyManager PagesPropertyManager Pages
.NET Interop Assemblies
Quick Tips and Bubble ToolTips
Return Values
Expand SafeArraysSafeArrays
Selection Criteria
Selection Lists
Selections that Define Features
Setup Project to Distribute SOLIDWORKS Add-in
Smart Pointers
SOLIDWORKS Add-ins
SOLIDWORKS Objects
Sorting Tables
Splines
SQLite
STL Container Classes and Smart Pointers
Suspend Automatic Rebuilds
Sweep Features and SweepFeatureData Objects
System Options and Document Properties
Tessellation and Edges
Third-party Data in SOLIDWORKS Files
Thread Features and ThreadFeatureData Objects
Tracking IDs
Expand Type LibrariesType Libraries
Units
Unmanaged C++ and C++/CLI Code
VBA and SOLIDWORKS x64
Examples and Projects
Expand SOLIDWORKS API HelpSOLIDWORKS API Help
Expand SOLIDWORKS PDM Professional API HelpSOLIDWORKS PDM Professional API Help
Expand FeatureWorks API HelpFeatureWorks API Help
Expand SOLIDWORKS Costing API HelpSOLIDWORKS Costing API Help
Expand SOLIDWORKS Document Manager API HelpSOLIDWORKS Document Manager API Help
Expand SOLIDWORKS Routing API HelpSOLIDWORKS Routing API Help
Expand SOLIDWORKS Simulation API HelpSOLIDWORKS Simulation API Help
Expand SOLIDWORKS Sustainability API HelpSOLIDWORKS Sustainability API Help
Expand SOLIDWORKS Toolbox API HelpSOLIDWORKS Toolbox API Help
Expand SOLIDWORKS Utilities API HelpSOLIDWORKS Utilities API Help
Expand eDrawings API HelpeDrawings API Help
Hide Table of Contents

Add-in Icons

The add-in icon displays next to the add-in name in the SOLIDWORKS Add-in Manager dialog.

SOLIDWORKS supports add-in icons that are 32-bit PNG and BMP files with alpha channel. SOLIDWORKS recommends that you consult the internet and books containing information about creating transparent images with alpha channel.

Add-in icons must be 16x16 pixels in size.

The add-in loads its icon in the following order of preference:

  1. Icon file at registry-specified location:

    Version-specific: HKEY_LOCAL_MACHINE\SOFTWARE\SOLIDWORKS\SOLIDWORKS version\Addins\{CLSID}\Icon Path
    Version-independent: HKEY_LOCAL_MACHINE\SOFTWARE\SOLIDWORKS\AddIns\{CLSID}\Icon Path

    NOTE: You can specify Icon Path using the icon image's file name and its full path, its UNC path, or the path relative to where the add-in's DLL is located.

    In SOLIDWORKS 2013 SP0, and later, you can use a path relative to the SOLIDWORKS install_dir folder (typically C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS) in
    Icon Path. Specify the relative path and the file name of the add-in's icon; for example:

    subfolder1\subfolder2\image.png

     

  2. PNG file whose name matches the DLL name and resides in the DLL folder
  3. BMP file whose name matches the DLL name and resides in the DLL folder

If the add-in icon file resides in a folder other than the add-in project DLL folder, it must be explicitly registered in SwAddin.RegisterFunction() as follows:

#region SOLIDWORKS Registration

[ComRegisterFunctionAttribute]

public static void RegisterFunction(Type t)

{
     Microsoft.Win32.RegistryKey hklm = Microsoft.Win32.Registry.LocalMachine;

     Microsoft.Win32.RegistryKey hkcu = Microsoft.Win32.Registry.CurrentUser;

     string keyname = "SOFTWARE\\SOLIDWORKS\\Addins\\{" + t.GUID.ToString() + "}";

     Microsoft.Win32.RegistryKey addinkey = hklm.CreateSubKey(keyname);

     addinkey.SetValue(null, 0);

     addinkey.SetValue("Description", SWattr.Description);

     addinkey.SetValue("Title", SWattr.Title);

     #region Extract icon during registration

          BitmapHandler iBmp = new BitmapHandler();

          Assembly thisAssembly;

          thisAssembly = System.Reflection.Assembly.GetExecutingAssembly();

          String tempPath =
          iBmp.CreateFileFromResourceBitmap("_2012_PMP_Interfaces.AddInMgrIcon.bmp",
          thisAssembly);

          // Copy the bitmap to a suitable permanent location with a meaningful filename

          String addInPath = System.IO.Path.GetDirectoryName(thisAssembly.Location);

          String iconPath = System.IO.Path.Combine(addInPath, "AddInMgrIcon.bmp");

          System.IO.File.Copy(tempPath, iconPath, true);

          // Register the icon location

          addinkey.SetValue("Icon Path", iconPath );

     #endregion


     keyname = "Software\\SOLIDWORKS\\AddInsStartup\\{" + t.GUID.ToString() + "}";

     addinkey = hkcu.CreateSubKey(keyname);

     addinkey.SetValue(null, Convert.ToInt32(SWattr.LoadAtStartup),
     Microsoft.Win32.RegistryValueKind.DWord);

}

Changes to the icon file or registry take effect only after SOLIDWORKS is restarted.

The .NET add-in templates deliver add-in icon files called AddinIcon.bmp to the same folder as the .NET project class files. During compilation, this file is copied, renamed to match the DLL name, and registered in the same folder where the DLL resides. At runtime, AddinIcon.bmp displays next to the add-in in the Add-in Manager dialog.

To learn more about add-ins and their menu items and toolbars:



Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   Add-in Icons
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:



x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2018 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.