Book a Demo

Author Topic: Linking note to element feature  (Read 3563 times)

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Linking note to element feature
« on: March 11, 2010, 01:32:08 am »
Hi Everyone
I have been trying to create a link from a note to an element feature but not had any success.
Trawling throught the forum I see a couple of posts talking about the connection's StyleEx property. if, from within my code I look at an existing note linked to an element feature this property is the empty string.

What is the best approach to creating such a link

Thanks

Graham
Using V12

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Linking note to element feature
« Reply #1 on: March 11, 2010, 01:54:18 am »
Graham,

Should be something like
Code: [Select]
Connector newConnector = (EA.Connector)Note.Connectors.addNew(" ","NoteLink");
newConnector.TargetID = targetElement.ElementID;
newConnector.Update()

Geert

Disclaimer: I just wrote that piece of code out of memory, adjust where necesarry. ;)

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: Linking note to element feature
« Reply #2 on: March 11, 2010, 01:56:57 am »
Hi Geert
Think you slightly misunderstood me.
I can (and indeed have) created a link to an element.
What I want to do is to use the 'Link note to element feature' part of the EA UI.
I cannot see an obvious way!
Any clues

Thanks

Graham
Using V12

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: Linking note to element feature
« Reply #3 on: March 11, 2010, 03:02:05 am »
Hello again
I have found that the required setting is in pdata1 but unfortuneatly this is read only
Anyone got any other ideas

Graham
Using V12

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: Linking note to element feature
« Reply #4 on: March 11, 2010, 04:05:19 am »
Some more progress!
I have managed to update the value in PDATA1 by doing this
Code: [Select]
string query = "UPDATE t_object SET PDATA1='Element Note' WHERE Object_ID=" + noteElement.ElementID;
                    Repository.Execute(query);
I can see this change reflected in the DB using MS Access

BUT

The note element on the diagram does not reflect this ie it is blank

Anyone help with this please

Graham
Using V12