Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: keesbghs on May 12, 2025, 09:35:01 pm

Title: How to find the destination of a Connector of a Realize (Python win32com API)
Post by: keesbghs on May 12, 2025, 09:35:01 pm
Background.

I'm investigating the possibility to read Requirements and "solutions" from an EA project. I am using Python with the win32com library. Much of the documentation I find from this Reference https://sparxsystems.com/enterprise_architect_user_guide/17.0/add-ins___scripting/reference.html (https://sparxsystems.com/enterprise_architect_user_guide/17.0/add-ins___scripting/reference.html). At the moment my Python code can see all the Packages, Elements and Connectors.

The problem.

However, given a Connector (https://sparxsystems.com/enterprise_architect_user_guide/17.0/add-ins___scripting/connector2_2.html (https://sparxsystems.com/enterprise_architect_user_guide/17.0/add-ins___scripting/connector2_2.html)) I cannot see what it is connecting to. The one end of the connector is obvious, that's the Element->Realize where I find the connector. What is the other end? There is a ConnectorEnd, but that doesn't help me (yet).

Strangely, when I digest the raw database I can see a t_connector table, which does have a Start_Object_ID and a End_Object_ID. I even wrote some Python code with SQLalchemy (which BTW is way faster than the win32com method). This basically gives the information that I need. But I don't want to have to mix SQL and win32com. I also have to modify Packages/Elements which I certainly don't want to change via SQL.
Title: Re: How to find the destination of a Connector of a Realize (Python win32com API)
Post by: keesbghs on May 12, 2025, 10:21:02 pm
Maybe I'm just confusing what Connector is. Maybe it is just the Realize itself that I should be looking at.
Title: Re: How to find the destination of a Connector of a Realize (Python win32com API)
Post by: Geert Bellekens on May 12, 2025, 11:13:09 pm
A connector as a ClientID (ElementID of the source) and SupplierID (ElementID of the target)
This corresponds to Start_Object_ID and End_Object_ID (naming them the same wouldn't have been too easy ;D)

Geert
Title: Re: How to find the destination of a Connector of a Realize (Python win32com API)
Post by: keesbghs on May 13, 2025, 10:57:21 pm
Correct, these are the ones. Thanks

I should have payed more attention to the "ElementID" in "The ElementID of the element at the source end of this connector." I don't know why I didn't see that one before.