- With the help of DraftSight API Project templates you can create add-in projects & load them into DraftSight.
1. If you click on this DraftSight Project Template and get an “Error: This template attempted to load component assembly… ” then Go to Tools > Extensions and Updates > uninstall “NuGet Package Manager for Visual Studio” now in Click on Online option on same dialog box > Search for Nuget Package Manager – download & install it. > Restart Visual Studio
- When you build project using this template in Visual Studio then it creates an Add-in & adds it to DraftSight Menubar Tools > Add-ins manager.
- This add-in will add new command for command window, Menu item in menu bar & toolbar button.
# DraftSight API Project template File :
DraftSight VB.Net & C# API Project templates Consists of following Files:
- BitmapHandler – This file contains the class to handle the add-in’s images
- DsAddin – This file contains the main add-in class.
- DsAddinCommand – This file contains the DsAddinCommand class that handles events thrown when a command executes.
- DsAddinDocument – This file contains the DsAddinDocument class that handles events thrown by open drawing documents
- DsAddinUserCommand – This file contains the DsAddinUserCommand class, which you use to create commands for menu items and toolbar items, get command IDs, and validate commands.
Check all Files in Solution Explorer of Visual Studio.