Book a Demo

Author Topic: Create and add Hyperlink from diagram to diagram  (Read 3907 times)

Markus Bauernfeind

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Create and add Hyperlink from diagram to diagram
« on: February 15, 2017, 11:40:11 pm »
How do I create an Hyperlink from a diagram to be placed into an other diagram using the add-in mechanism.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Create and add Hyperlink from diagram to diagram
« Reply #1 on: February 16, 2017, 02:20:43 am »
A bit tricky (like so many things in EA). You need to create a Text element and set t_object.PDATA1 to the diagramId you want to link. The latter must be done with a SQL (use Repository.Execute) since the according MiscData from the API is r/o.

q.

Markus Bauernfeind

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Create and add Hyperlink from diagram to diagram
« Reply #2 on: February 16, 2017, 06:20:10 pm »
Thank you for your quick reply. But how do I create a Text element?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Create and add Hyperlink from diagram to diagram
« Reply #3 on: February 16, 2017, 07:20:25 pm »
As usual:

Code: [Select]
Package.Elements.AddNew("some name", "Text")
q.