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
namestringtext to display next to icon
hintstringtext to display in a tool-tip
tooltipTitlestringtool-tip title
iconBitmapicon for this command
nameofCallBackFuncstringname of function that this command calls THIS FUNCTION MUST BE DEFINED IN THE ADDIN CLASS. ADDIN CLASS IS THE ONE THAT INHERITS FROM AddinMaker
userIdshorta user id for this command
menuOptionintwhether this command should be in menu or toolbox or both as defined in SolidWorks.Interop.swconst.swCommandItemType_e
tabTextStyleinttext display of this command when used in a AddinCommandTab as defined by SolidWorks.Interop.swconst.swCommandTabButtonTextDisplay_e
enableMethodstringname 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
values if 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
CallBackFunction
name of the function this command will call
public string CallBackFunction { get; set; }
Property Value
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
EnableMethod
Optional function that controls the state of the item; if specified, then SOLIDWORKS calls this function before displaying the item
| values | if 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
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
IconBitmap
Bitmap object as an icon
public Bitmap IconBitmap { get; set; }
Property Value
Index
index of this command inside its command group object
public int Index { get; }
Property Value
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
Name
name as appears in SolidWORKS
public string Name { get; set; }
Property Value
SolidworksId
Id that SolidWORKS assigns to this command once created. it then gets used by command boxes
public int SolidworksId { get; }
Property Value
ToolTip
tool-tip for this command
public string ToolTip { get; set; }
Property Value
UserId
User-defined command ID or 0 if not used
public int UserId { get; set; }
Property Value
Methods
Dispose()
disposes the resourses
public void Dispose()