I would like to create programmatically a self-connector, using C#.
This is how I do it in case of an Association connector:
//Create new Association connector
object connectorObject = selElement.Connectors.AddNew("NewConnector", "Association");
EA.Connector connector = connectorObject as EA.Connector;
if (connector != null)
{
//self-connector
connector.SupplierID = selElement.ElementID;
connector.ClientID = selElement.ElementID;
connector.Update();
selElement.Update();
selDiagram.Update();
}
But when I try to create a sequence connector I get the following error:
object connectorObject = selElement.Connectors.AddNew("NewConnector", "Sequence");
Any ideas?
Sequence is only allowed for lifelines in a sequence diagram. Elsewhere it will not show up.
I was able to create such a connector for elements but they will not show in class diagrams.
Also I did not see the error you got. It might come from an MDG with own validation rules.
Edit: If you create a sequence manually from the toolbox (Other/UML/Interaction/Message) the connector also appears on class diagrams - but very strange xD
EDIT (from Geert): Deselecting the Tools -> Options -> Links -> Strict Connector Syntax suppresses the error message box.