Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Hoefler1 on March 29, 2016, 04:38:14 pm

Title: Get Diagram of a Hyperlink
Post by: Hoefler1 on March 29, 2016, 04:38:14 pm
Hello,

Having a DiagramObject (e.g. as a Hyperlink, DiagramFrame etc.) that links to another diagram in my Project (on doubleclick),
how can I access the diagram it links to, itself?

Thank you all in advance
Title: Re: Get Diagram of a Hyperlink
Post by: Geert Bellekens on March 29, 2016, 05:23:35 pm
In case of a hyperlink to a diagram the diagramID is stored in PDATA1 aka MiscData(0)

Geert
Title: Re: Get Diagram of a Hyperlink
Post by: Hoefler1 on March 29, 2016, 07:02:40 pm
Hello Geert,

the MiscData is only available if there was a Connector.
But in my case I only have this Hyperlink-Object on a Diagram, as it can be chosen when dragging a diagram from project browser onto another diagram.
Title: Re: Get Diagram of a Hyperlink
Post by: Geert Bellekens on March 29, 2016, 07:37:41 pm
Hello Geert,

the MiscData is only available if there was a Connector.
But in my case I only have this Hyperlink-Object on a Diagram, as it can be chosen when dragging a diagram from project browser onto another diagram.

I don't think that is true. There's Miscdata on an EA.Element as well.

Geert
Title: Re: Get Diagram of a Hyperlink
Post by: Hoefler1 on March 29, 2016, 07:59:47 pm
I don't think that is true. There's Miscdata on an EA.Element as well.

Geert

I'm sorry. You're right.
I had to use Element.get_MiscData(0) to access the DiagramID. Looks like it would work  ;)

Thanks!