Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Helmut Ortmann on July 18, 2012, 12:52:46 am
-
Hello,
I have a Composite Structure Diagram with a class and two parts inside the enclosing class. The two parts are connected by a flow or a connector. The flow is selected and the addin should return the flow after calling GetContextItem. It returns the enclosing class instead.
Without the enclosing task everything works as expected.
Thanks,
Helmut
-
Helmut,
GetContextItem returns an element. If you want to get hold of the connector try the diagram's SelectedConnector method.
q.
-
Hi,
thanks a lot. Looks simple but I wasn't aware of it.
Kind regards,
Helmut
-
Helmut,
GetContextItem returns an element. If you want to get hold of the connector try the diagram's SelectedConnector method.
q.
q.
I think you are wrong here. I use GetContextItem to get whatever is selected (including connectors) and according to the documentation of of the method GetContextItemType it should:
Returns the ObjectType of an item in context within Enterprise Architect. A ContextItem is defined as an item selected anywhere within the Enterprise Architect GUI including:
· An item selected in the Project Browser
· An item selected in an open diagram
· An item selected in certain dialogs, such as the attribute Properties dialog
The supported ObjectTypes can be any one of the following values:
· otElement
· otPackage
· otDiagram
· otAttribute
· otMethod
· otConnector
So if it returns the containing Element i.s.o. the selected connector then I guess you can call it a bug and report it to Sparx.
Geert
-
You're right. But obviously Helmut needed the fallback as the official method did not work. How did I call that? Ah! Geert-around....
q.
P.S. I have tried Helmut's configuration and for me it returned the connector correctly.
-
Hello Thomas, Hello Geert,
thanks a lot!
I have my workaround and I will post a bug report.
Kind regards,
Helmut