solidworks-api icon indicating copy to clipboard operation
solidworks-api copied to clipboard

create addin using interop 2017

Open sylbat opened this issue 3 years ago • 1 comments

Hi, I have used your tutorials "04 Selected objects" to create an add in of my own. This has been done using the integrated interop which are version 2020. I have a running version of SW 2020 on my laptop. The addin is finished now but I just learned that the users that should be using this addin are running SW 2017. I tried to replace the interop 2020 with the 2017 ones, but I cannot regenerate the project in Visual Studio. The error I'm getting are all missing components. Example : error CS0246: The type or namespace name 'IAdvancedHoleFeatureData' could not be found (are you missing a using directive or an assembly reference?) - Project AngelSix.SolidDna - File FeatudeAdvancedHoleWizardData.cs - line 8 and line 15 I have 24 other similar messages for other features. How should I proceed ? thanks for your help.

sylbat avatar Mar 23 '21 10:03 sylbat

I'd better answer this late than never. The DLL version that you use does not have to be the one that the user has. I use SW2021 DLLs and my add-ins still work on SW2017. I added SW2021 features to SolidDna a while ago, so you should keep those DLLs.

When SolidWorks starts your add-in, it already has its own DLLs loaded so it will ignore yours. But for the add-in to work perfectly, you should avoid using any features that are newer than SW2017. I do the same, and all of my bookmarks are to 2017 help pages to minimize the chance of me using newer APIs.

I also have a check in my installer that prevents users to install the add-in if they have SW2016 or older.

brinkdinges avatar Apr 06 '21 21:04 brinkdinges