SolidEdgeCommunity / SolidEdge.Community.AddIn

Community enhancements for developing Solid Edge AddIns.
MIT License
7 stars 6 forks source link

Two AddIns registered and only the first one that is used works #6

Open Steve-771 opened 7 years ago

Steve-771 commented 7 years ago

Hi Jason,

We have created two different AddIns that use different environments from one another.

The first AddIn is only for the Draft environment and the second is only for the Assembly environment.

After opening Solid Edge, if a Draft is opened, the OnConnection and OnConnectToEnvironment subs will run for the first AddIn. If an assembly is then opened, the ribbons for the second AddIn are not visible and the OnConnection and OnConnectToEnvironment subs are never called.

The same thing happens if an Assembly is opened first, only the it is the second AddIn that works and the first AddIn that does not.

Any ideas as to why you cannot have two different AddIns?

I appreciate any help or insight you can provide.

FrankvdStamVlastuin commented 6 years ago

I think the addin must always be loaded or initialized, even if you don't want it visible for a certain filetype. I use bellow code to only add controlls for my addin when the file opened is of a certain filetype:

//Called when ribbons must be added. public override void OnCreateRibbon(SolidEdgeCommunity.AddIn.RibbonController controller, Guid environmentCategory, bool firstTime) { //Only add the ribbon when asm/draft/part/psm is opened if (environmentCategory.Equals(SolidEdgeSDK.EnvironmentCategories.Assembly) || environmentCategory.Equals(SolidEdgeSDK.EnvironmentCategories.SheetMetal) || environmentCategory.Equals(SolidEdgeSDK.EnvironmentCategories.Part) || environmentCategory.Equals(SolidEdgeSDK.EnvironmentCategories.Draft)) { controller.Add(environmentCategory, firstTime); } }

ste71m commented 6 years ago

Same issue. I created my addin based on DemoAddIn, changed GUID, clsId But they can't be loaded at the same time, only one is loaded

jlnewell commented 6 years ago

@ste71m please reply with the GUID of both addins.

ste71m commented 6 years ago

MyAddin: Guid("52BA0728-92CF-42A0-B2AA-C6B20CC1FBCB") DemoAddin: Guid("605BB737-AA7E-434C-9E40-322BE8CBF1F1")

My bet is because i'm using different interop version (108 in mine and 110 in demo) I made a copy of your DemoAddin and named DemoAddin2 and they both loaded I realized the problem when a customer installed my addin and he also had another addin made by another company. I could not load mine until disabled the other one

jlnewell commented 6 years ago

Indeed this is an issue. SolidEdge.Community.AddIn needs to be rethought and reworked.

ste71m commented 6 years ago

Thanks anyway for taking the time to investigate the issue

Steve-771 commented 6 years ago

Our workaround has been to have all of our Add-Ins put in a single Add-in.

ste71m commented 6 years ago

@Steve-771 The only problem is that the other addin is not ours :-) Thanks anyway

alexhumphrey commented 5 years ago

Hi @jlnewell, I wonder if you have had, or would have, a chance to investigate this further? I appreciate the code's all on github so we can help ourselves, but I'm afraid it's beyond me.