The documentation regarding the Draftsight API seems to be lacking. It specifically states the following:
"When you installed the DraftSight API SDK, the DraftSight API project templates for Microsoft Visual Studio VB.NET, C#, and C++ were installed if Microsoft Visual Studio was detected on your computer. After installing the DraftSight API SDK, the DraftSight API project templates are available in Microsoft Visual Studio's New Project dialogs."
The problem is, there is no installation process for the API SDK that I can find. I did not install it. There is no download, there is no installer. When I installed Draftsight Professional 2016, the SDK kit seems to have been installed at that point automatically. The following assemblies are in fact present:
- Type libraries:
- install_dir\\APISDK\\tlb\\dsAddin.tlb
- install_dir\\bin\\dsAutomation.dll
- Primary interop assemblies:
- install_dir\\APISDK\\tlb\\DraftSight.Interop.dsAddin.dll
- install_dir\\APISDK\\tlb\\DraftSight.Interop.dsAutomation.dll
References to the files can be created in VS for 3 of the 4 files. When I try to create a reference to the "dsAddin.tlb" assembly, however, I get an error saying it is not a valid assembly. References to the other dlls work fine.
There is a directory called "APISDK", with some sample files. The problem is the Draftsight API templates were NOT in fact installed in MS Visual Studio Project Template locations. I can not find them on my system anwhere. I can probably fumble around an create them from scratch, but it sure seems like this documentation is clumsy here. Where can I get the add in template solution file "DSAddinCSharp"?
Update: Using 7-Zip, I explored the DraftSight Installer (DraftSight64.exe) cab folders, and the template is in there(dsaddincsharp.zip). I took the zip file (without extracting it) and copied it to my Visual Studio Project Template folder. This is a trick I used to get the Solidworks template to work perfectly. The DS Addin Template still does not work. It shows up with the template icon when I select New -> Project in Visual Studio, but when I try to use the template, I get the following error:
Error: this template attempted to load component assembly 'DraftSightAddinWizard, Version = 1.0.0.0, Culture=Neutral, PublicKeyToken=179e62c887fed2003'. For more information on this problem and how to enable this template, please see documentation on Customizing Project Templates.
Do I need to copy the draftsightaddinwizard.dll file to standard VisualStudio dll searchpath location?
Also, I explored the files, and I see that they make use of the IWizard Interface. I assume I need to add that reference? The Microsoft.VisualStudio.TemplateWizard.dll is in the Visual Studio IDE directory, but I would need to browse to it.
Overall, it seems that there should be a better description of how to do all this.
