You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://www.nuget.org/packages/Inventor.AddinTemplate)
4
+
3
5
## Overview
4
6
5
-
## Installation
7
+
The goal of this template is to make crafting an Inventor addin as easy as possible. All that is required is to create the buttons and write the code that will be executed when the buttons are clicked. The template will handle adding the buttons to the ribbon.
8
+
9
+
10
+
The template is designed to be used with Visual Studio or JetBrains Rider.
6
11
7
-
### Visual Studio
12
+
##Installation
8
13
9
-
### JetBrains Rider
14
+
The template can be installed using the dotnet CLI. The command to install the latest version can be found on the [NuGet.org page](https://www.nuget.org/packages/InventorAddinTemplate/).
10
15
11
16
## Usage
12
17
18
+
Once the template is installed it will appear in the list of available project templates in Visual Studio and Rider.
19
+
13
20
### Addin Components
14
21
15
22
These are the components that will be created when the addin is compiled.
@@ -20,11 +27,28 @@ The .addin file is the entry point for the addin. It is an XML file that describ
20
27
21
28
The .addin file is a pointer to the .dll file. It is also used to specify the addin's name, description, and other properties.
22
29
23
-
24
30
#### .dll File
25
31
26
32
The .dll file is the compiled addin. It is a dynamic link library that contains the addin's code.
27
33
28
34
### Adding Buttons
29
35
30
-
## Testing / Debugging
36
+
Adding buttons is very simple. Just create a class that inherits the `InventorButton` class and implement the abstract methods. The `InventorButton` class will handle adding the button to the ribbon and executing the code when the button is clicked.
37
+
38
+
All button classes in this project will be loaded into the Inventor UI. A button can be prevented from being loaded by overriding the `Enabled` property to return `false`.
39
+
40
+
#### Execute Method
41
+
42
+
This method is called when the button is clicked. This is where the code that the button will execute should be placed.
43
+
44
+
#### Ribbon Tabs and Panels
45
+
46
+
The `GetRibbonName()` and `GetRibbonPanelName()` methods are used to specify the tab and panel that the button will be added to. If the name matches the `InternalName` of an existing tab or panel the button will be added to that tab or panel. Otherwise a new tab or panel will be created.
47
+
48
+
Internal names can be found using the [Inventor.InternalNames](https://www.nuget.org/packages/Inventor.InternalNames) package that is included with this template.
49
+
50
+
#### Icon Resources
51
+
52
+
Button icons need to be .PNG files and be added to the project as embedded resources.
53
+
54
+
Check out the `DefaultButton` class for an example of how to add a button to the ribbon.
0 commit comments