Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: sig550 on February 16, 2017, 01:03:47 am
-
Hey,
I'm trying to create an addin in VS C# which automatically creates a sequence diagram. I can add elements and I can add connectors from element a to element b, but the order of the connectors goes wrong. Example:
I set the relations as followed:
1) A ---> B
2) B ---> C
3) A ----------> C
But 2) and 3) swapped to the following result:
1) A ---> B
3) A ----------> C
2) B ---> C
It looks like he prints all connectors from element a first, then all from element b and so on. Is there a way to set the order of the connectors like added?
-
It seems like this is controlled by Connector.EndPointY. I have not tried that, but this corresponds to the order in the diagram. There's also Connector.StateFlags which seem to play a role.
q.
-
For sequence diagram messages you have to set the Sequence Number (t_connector.SeqNo in the database)
Geert
-
Could you give me a short example how to work with the database in EA? There should be something to get access to the DB. Like a connector or a database object.
sig550
-
Use the SQL Search scratch pad for only queries. Repository.SQLQuery(query) returns a XML result set. And (shameless plug) look into my Inside book.
q.
-
You don't need to access the database for this one. You can use EA.Connector.SequenceNo
Geert
-
Thank you very much, works perfect.