AnsweredAssumed Answered

Is it better to do various functions with one add-in or have a separate add-in for each function?

Question asked by Ben Nemec on Dec 21, 2020
Latest reply on Dec 25, 2020 by Amen Allah Jlili

We have been using a PDM Task Add-In that I wrote that saves a pdf or dxf from Solidworks or the other CAD system we use and it's working fine, but just because it works doesn't mean it's the best way or correct way to accomplish the objective.  And yes, we did start with the Solidworks add-in for the pdf and dxf from SW however I still had to make a task add-in to get pdfs and dxfs from the other CAD system, so I put them together so I could just have one action in the transitions.  I do the which CAD logic in the add-in instead of workflow transition task action conditions, ie the task is ran on either CAD system drawing then the add-in reads file extension and proceeds accordingly.


In the task setup dialog (PDM Admin Tool) I have the option to save pdf or dxf, then that is saved the mpo.Extra so when I get to the OnCommand call I can read it back with GetValEx and check which to do. This is the only experience I have with writing task add-in so I don't know if it's best to put various functions all in one add-in then use the task vars at run time to select what to do or break the functions out into separate add-in dlls so each on only does one function.


Since what I have is working I would probably just leave it, but I'm about to add some more automated functionality and I cannot decide if I should make a new project in my Visual Studio Solution for a separate add-in or just keep one add-in and use the task setup dialog in the Admin Tool to choose which function is run.


As a side note I try to follow Object Oriented practices so I have several class libraries that are loaded when I add the add-in in the admin tool.  Example, the API stuff for the two CAD systems are each in their own library.