Skip to content

Commit d2410f4

Browse files
committed
Updated Readme
1 parent d01a2fa commit d2410f4

File tree

4 files changed

+37
-7
lines changed

4 files changed

+37
-7
lines changed

.template.config/template.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@
7676
"replaces": "<PackageProjectUrl>https://github.com/bretleasure/Inventor.AddinTemplate</PackageProjectUrl>",
7777
"defaultValue": ""
7878
},
79+
"url2": {
80+
"type": "parameter",
81+
"datatype": "text",
82+
"description": "project property url cleanup",
83+
"replaces": "<RepositoryUrl>https://github.com/bretleasure/Inventor.AddinTemplate</RepositoryUrl>",
84+
"defaultValue": ""
85+
},
7986
"readme": {
8087
"type": "parameter",
8188
"datatype": "text",

Buttons/InventorButton.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ internal InventorButton()
6565
/// <summary>
6666
/// Controls whether the button is enabled or not. If false, the button will be disabled (greyed out) and cannot be clicked.
6767
/// </summary>
68-
public bool Enabled
68+
public virtual bool Enabled
6969
{
7070
get => Definition.Enabled;
7171
set => Definition.Enabled = value;

Inventor.AddinTemplate.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<ContentTargetFolders>content</ContentTargetFolders>
2222
<NoWarn>$(NoWarn);NU5128</NoWarn>
2323
<NoDefaultExcludes>true</NoDefaultExcludes>
24-
<Version />
2524
<RepositoryUrl>https://github.com/bretleasure/Inventor.AddinTemplate</RepositoryUrl>
2625

2726

README.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
# Inventor Addin Template
22

3+
[![NuGet version (Inventor.AddinTemplate)](https://buildstats.info/nuget/Inventor.AddinTemplate)](https://www.nuget.org/packages/Inventor.AddinTemplate)
4+
35
## Overview
46

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.
611

7-
### Visual Studio
12+
## Installation
813

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/).
1015

1116
## Usage
1217

18+
Once the template is installed it will appear in the list of available project templates in Visual Studio and Rider.
19+
1320
### Addin Components
1421

1522
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
2027

2128
The .addin file is a pointer to the .dll file. It is also used to specify the addin's name, description, and other properties.
2229

23-
2430
#### .dll File
2531

2632
The .dll file is the compiled addin. It is a dynamic link library that contains the addin's code.
2733

2834
### Adding Buttons
2935

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

Comments
 (0)