Table of Contents

Class AddinCommand

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

a wrapper for a command in solidworks

public class AddinCommand : IDisposable
Inheritance
AddinCommand
Implements
Inherited Members

Constructors

AddinCommand()

default constructor

public AddinCommand()

AddinCommand(string, string, string, Bitmap, string, short, int, int, string)

constructor

public AddinCommand(string name, string hint, string tooltipTitle, Bitmap icon, string nameofCallBackFunc, short userId = 0, int menuOption = 3, int tabTextStyle = 2, string enableMethod = "")

Parameters

name string

text to display next to icon

hint string

text to display in a tool-tip

tooltipTitle string

tool-tip title

icon Bitmap

icon for this command

nameofCallBackFunc string

name of function that this command calls THIS FUNCTION MUST BE DEFINED IN THE ADDIN CLASS. ADDIN CLASS IS THE ONE THAT INHERITS FROM AddinMaker

userId short

a user id for this command

menuOption int

whether this command should be in menu or toolbox or both as defined in SolidWorks.Interop.swconst.swCommandItemType_e

tabTextStyle int

text display of this command when used in a AddinCommandTab as defined by SolidWorks.Interop.swconst.swCommandTabButtonTextDisplay_e

enableMethod string

name of optional function that controls the state of the item; if specified, then SOLIDWORKS calls this function before displaying the item THIS FUNCTION MUST BE DEFINED IN THE ADDIN CLASS. ADDIN CLASS IS THE ONE THAT INHERITS FROM AddinMaker

valuesif returned value of enabled function is:
SOLIDWORKS De-selects and disables the item
SOLIDWORKS De-selects and enables the item; this is the default state if no update function is specified
SOLIDWORKS Selects and disables the item
SOLIDWORKS Selects and enables the item
Not supported

Properties

BoxId

commands that have the same box id will be grouped together and separated by a '|'

public int BoxId { get; set; }

Property Value

int

CallBackFunction

name of the function this command will call

public string CallBackFunction { get; set; }

Property Value

string

Remarks

THIS FUNCTION MUST BE DEFINED IN THE ADDIN CLASS. ADDIN CLASS IS THE ONE THAT INHERITS FROM AddinMaker

CommandTabTextType

text display of this command when used in a AddinCommandTab as defined by SolidWorks.Interop.swconst.swCommandTabButtonTextDisplay_e
default is 2

public int CommandTabTextType { get; set; }

Property Value

int

EnableMethod

Optional function that controls the state of the item; if specified, then SOLIDWORKS calls this function before displaying the item

valuesif returned value of enabled function is:
SOLIDWORKS De-selects and disables the item
SOLIDWORKS De-selects and enables the item; this is the default state if no update function is specified
SOLIDWORKS Selects and disables the item
SOLIDWORKS Selects and enables the item
Not supported
public string EnableMethod { get; set; }

Property Value

string

Remarks

THIS FUNCTION MUST BE DEFINED IN THE ADDIN CLASS. ADDIN CLASS IS THE ONE THAT INHERITS FROM AddinMaker

HintString

hint for this command

public string HintString { get; set; }

Property Value

string

IconBitmap

Bitmap object as an icon

public Bitmap IconBitmap { get; set; }

Property Value

Bitmap

Index

index of this command inside its command group object

public int Index { get; }

Property Value

int

MenuOptions

whether this command should be in menu or toolbox or both as defined in SolidWorks.Interop.swconst.swCommandItemType_e
default is 3

public int MenuOptions { get; set; }

Property Value

int

Name

name as appears in SolidWORKS

public string Name { get; set; }

Property Value

string

SolidworksId

Id that SolidWORKS assigns to this command once created. it then gets used by command boxes

public int SolidworksId { get; }

Property Value

int

ToolTip

tool-tip for this command

public string ToolTip { get; set; }

Property Value

string

UserId

User-defined command ID or 0 if not used

public int UserId { get; set; }

Property Value

int

Methods

Dispose()

disposes the resourses

public void Dispose()