Table of Contents

Class AddinCommandGroup

Namespace
Hymma.Solidworks.Addins
Assembly
Hymma.Solidworks.Addins.dll

a model for SolidWorks.Interop.sldworks.CommandGroup

public class AddinCommandGroup : IAddinCommandGroup
Inheritance
AddinCommandGroup
Implements
Derived
Inherited Members

Constructors

AddinCommandGroup()

this constructor is added to be used in the Fluent API.

public AddinCommandGroup()

AddinCommandGroup(int, IEnumerable<AddinCommand>, string, string, string, string, Bitmap, bool, bool)

default constructor

public AddinCommandGroup(int userId, IEnumerable<AddinCommand> commands, string title, string description, string tooltip, string hint, Bitmap icon, bool hasToolbar = true, bool hasMenu = true)

Parameters

userId int

If you change the definition of an existing CommandGroup (i.e., add or remove toolbar buttons), you must assign a new unique user-defined UserID to that CommandGroup.
You must perform this action to avoid conflicts with any previously existing CommandGroup and to allow for backward and forward compatibility of the CommandGroups in your application.
The user ID and the GUID of the CoClass implementing ISwAddin are a unique pair.

commands IEnumerable<AddinCommand>

a list of AddinCommand this group presents

title string

To add a menu item for a CommandGroup to an existing SOLIDWORKS menu, specify the name of a parent menu here.
"&Help\MyApp Title"

description string

Description of this AddinCommandGroup

tooltip string

Tool-tip of this AddinCommandGroup

hint string

A Hint for this AddinCommandGroup

icon Bitmap

Bitmap object as icon for this command group inside the command manager

hasToolbar bool

does it have tool-bar

hasMenu bool

should it be presented in a menu

Fields

_commandIcons

command icons

protected string[] _commandIcons

Field Value

string[]

_groupIcons

group icons

protected string[] _groupIcons

Field Value

string[]

Properties

CommandIcons

returns list of command strips for this command group

public string[] CommandIcons { get; }

Property Value

string[]

Commands

an array of AddinCommand this group presents

public IEnumerable<AddinCommand> Commands { get; set; }

Property Value

IEnumerable<AddinCommand>

Description

Description of this AddinCommandGroup

public string Description { get; set; }

Property Value

string

GroupIcon

returns a list of command group icon in standard solidworks sizes

public string[] GroupIcon { get; }

Property Value

string[]

HasMenu

if it has menue

public bool HasMenu { get; set; }

Property Value

bool

HasToolbar

defines if this command group has toolbar or not

public bool HasToolbar { get; set; }

Property Value

bool

Hint

A Hint for this AddinCommandGroup

public string Hint { get; set; }

Property Value

string

IconsDir

this is the directory where the icons will get saved to

public DirectoryInfo IconsDir { get; set; }

Property Value

DirectoryInfo

IgnorePrevious

Set this to true to prevent SOLIDWORKS from saving the current toolbar setting to the registry, even if there is no previous version.

public bool IgnorePrevious { get; set; }

Property Value

bool

IsRegistered

Determines if command Group with the current UserId is registered in the Registry
use IgnorePrevious to decide a new commandGroup is required or not

public bool IsRegistered { get; set; }

Property Value

bool

Remarks

If you changed this IAddinCommandGroup in the newer versions of your addin and this method returned true, you should change the UserId .Otherwise you will face compatibility issues

MainIconBitmap

Bitmap object as icon

public Bitmap MainIconBitmap { get; set; }

Property Value

Bitmap

Position

position of this command group in command manager 0 is on top and -1 is at the bottom

public int Position { get; set; }

Property Value

int

Title

To add a menu item for a CommandGroup to an existing SOLIDWORKS menu, specify the name of a parent menu here.
"&Help\MyApp Title"

public string Title { get; set; }

Property Value

string

ToolTip

Tooltip of this AddinCommandGroup

public string ToolTip { get; set; }

Property Value

string

UserId

If you change the definition of an existing CommandGroup (i.e., add or remove toolbar buttons), you must assign a new unique user-defined UserID to that CommandGroup.
You must perform this action to avoid conflicts with any previously existing CommandGroup and to allow for backward and forward compatibility of the CommandGroups in your application.
The user ID and the GUID of the CoClass implementing AddinMaker are a unique pair.

public int UserId { get; set; }

Property Value

int