Skip to content

Running multiple add-ins at the same time #86

@brinkdinges

Description

@brinkdinges

I'm running into the fact that SolidDna can't really run two add-ins at the same time. Since SolidWorks can't differentiate two dll's with the same name, only one instance of SolidDna runs. If both add-ins use the same version for all libraries, they might start.

I've done some debugging today and this is what I'm seeing. What happens when you start the second add-in is:

  1. AddInIntegration's static properties SolidWorksAddInTitle, SolidWorksAddInDescription and SolidWorks are overwritten.
  2. PlugInIntegration.Plugins is overwritten with the plugins from the second add-in.
  3. Both add-ins actually may start properly

Shutting down one add-in does not go well:

  1. When you unload one of the add-ins using the Add-ins window in SolidWorks, PlugInIntegration.DisconnectedFromSolidWorks is called
  2. DisconnectedFromSolidWorks is called on each plugin in Plugins. Plugins contains only the plugins for the add-in that was loaded last. So the wrong items may be unloaded.
  3. AddInIntegration.SolidWorks is set to null
  4. When the second add-in is unloaded, the Disconnect event gets fired, but the wrong add-in might be informed and the SolidWorks property is already null. So sometimes the second add-in doesn't unload and then a SolidWorks process keeps running.

My suggestions are:

  1. To make AddInIntegration's static properties SolidWorksAddInTitle, SolidWorksAddInDescription (and SolidWorks?) instance properties
  2. Store a list of plugins in the add-in instance, remove the static list of plugins. Move PluginDetails as well?
  3. Create a static list of add-ins. Add the add-in in its ctor, remove it from the list in AddInIntegration.DisconnectFromSW.

I'm already making these changes, but I'm having trouble overseeing the implications. So if anyone would like to help that would be great :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions