Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: GrahamL on June 12, 2020, 08:02:59 pm

Title: Processing connectors in addin
Post by: GrahamL on June 12, 2020, 08:02:59 pm
Hi
Suppose I have 2 elements linked via a connector.
In my addin I am looping through the elements in a package and within the loop I am looping through the connectors
Obviously each element has a connector (the same one).
During my processing of the connector I want to able to identify which is the source and which is the destination but cant see how to do this?

Any hints

Thanks
Title: Re: Processing connectors in addin
Post by: Geert Bellekens on June 12, 2020, 08:13:10 pm
You have to compare the SupplierID and ClientID with the ElementID of your element.

Geert

PS. This is a potentially very slow way to get to your connectors. You can also get the connectorID's you need using Repository.SQLQuery and then get the connectors using Repository.GetConnectorByID
Title: Re: Processing connectors in addin
Post by: GrahamL on June 12, 2020, 08:15:42 pm
Thanks
I have no experience of using sql queries so will have to go learn
Title: Re: Processing connectors in addin
Post by: Geert Bellekens on June 12, 2020, 08:45:16 pm
You can find a lot of example in C# https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework (https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework) or vbscript https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library (https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library)

Geert
Title: Re: Processing connectors in addin
Post by: GrahamL on June 12, 2020, 08:46:23 pm
Cheers