Book a Demo

Author Topic: Show tags automatically  (Read 4393 times)

tom van de poel

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Show tags automatically
« on: October 15, 2013, 12:59:43 am »
I wrote a script which creates elements and with tagged values. Also it draws the elements automatically on a diagram. So far so good.
Now i'm trying to find how to display the tagged values automatically.
Read the book Scripting EA, search the internet, but can't find the right method or property.

Somebody can help?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Show tags automatically
« Reply #1 on: October 15, 2013, 01:56:24 am »
Look into chapter 10.15 of my Inside book. You need to turn on the Tags compartment.

q.

tom van de poel

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Show tags automatically
« Reply #2 on: October 15, 2013, 02:12:18 am »
Ok firing a SQL query something like update t_diagramobjects set objectstyle with the string "tag=1" will do the job?
Lets try :)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Show tags automatically
« Reply #3 on: October 15, 2013, 04:23:06 am »
You should also be fine to set DiagramObject.ObjectStyle via the API.

q.

tom van de poel

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Show tags automatically
« Reply #4 on: October 15, 2013, 04:54:10 am »
Well just finished coding with the following and it works. Not all the subroutines included but just for the idea ;)

Code: [Select]
Private Sub UpdateFeatureTags(eaConn As EAConnector, lsObjectID As String
    Dim SQL   As String
    Dim IDs() As String
    
    SQL = "SELECT objectstyle FROM t_diagramobjects WHERE object_id=" & lsObjectID
    If BuildArrayFromSQL(eaConn.EARepos, SQL, "objectstyle", IDs) Then
        eaConn.EARepos.Execute ("update t_diagramobjects set objectstyle = '" & IDs(0) & ";Tag=1;AttCustom=0;OpCustom=0;RzO=1;;10199;' where object_id = " & lsObjectID)
    End If
End Sub

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Show tags automatically
« Reply #5 on: October 15, 2013, 05:16:30 am »
I suppose the trailing ;10199; is superfluous as the ObjectStyle just consumes CSV style key/value pairs.

q.