Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

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

Open
Steve-771 opened this issue Jan 13, 2017 · 9 comments
Open

Comments

@Steve-771
Copy link

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.

@Steve-771 Steve-771 changed the title Two AddIns registered and only one is connected to Two AddIns registered and only the first one that is used works Jan 13, 2017
@FrankvdStamVlastuin
Copy link

FrankvdStamVlastuin commented Apr 26, 2018

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
Copy link

ste71m commented Oct 12, 2018

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
Copy link
Member

@ste71m please reply with the GUID of both addins.

@ste71m
Copy link

ste71m commented Oct 12, 2018

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
Copy link
Member

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

@ste71m
Copy link

ste71m commented Oct 12, 2018

Thanks anyway for taking the time to investigate the issue

@Steve-771
Copy link
Author

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

@ste71m
Copy link

ste71m commented Oct 12, 2018

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

@alexhumphrey
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants