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
userIdintIf 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.commandsIEnumerable<AddinCommand>a list of AddinCommand this group presents
titlestringTo add a menu item for a CommandGroup to an existing SOLIDWORKS menu, specify the name of a parent menu here.
"&Help\MyApp Title"descriptionstringDescription of this AddinCommandGroup
tooltipstringTool-tip of this AddinCommandGroup
hintstringA Hint for this AddinCommandGroup
iconBitmapBitmap object as icon for this command group inside the command manager
hasToolbarbooldoes it have tool-bar
hasMenuboolshould 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
Description
Description of this AddinCommandGroup
public string Description { get; set; }
Property Value
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
HasToolbar
defines if this command group has toolbar or not
public bool HasToolbar { get; set; }
Property Value
Hint
A Hint for this AddinCommandGroup
public string Hint { get; set; }
Property Value
IconsDir
this is the directory where the icons will get saved to
public DirectoryInfo IconsDir { get; set; }
Property Value
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
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
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
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
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
ToolTip
Tooltip of this AddinCommandGroup
public string ToolTip { get; set; }
Property Value
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; }