Book a Demo

Author Topic: Show/hide Attributtes and Operations of a class in a specific diagramm  (Read 4114 times)

Benny

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Hi,

i´m facing a problem (again  ???).

I´m trying to hide or show the Attributes / Operations of a class in a diagram.
The values are in the Elements Setup Window=> Show Compartments => Attributes / Operations.
Also shown on page 130 Scripting EA ; )

I understand that the *.WriteStyle("") is only for the "Show Element Property String" and some other stuff, but how can I access the Attributes and Operations.

As a work around in an other Project I just hide the Private-statement at the Visible Class Members.

Function hideAtt (diagram)
         diagram.ShowPrivate(false)
         diagram.Update()
End Function

But at this time I need it more detailed. I need to write a script which hide the Attributtes and/or Operations based on the diagram name.

Maybe someone can give me a hint.

regards

Benny

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
This is a bit tricky. Diagrams can suppress individual operation/attributes. This is done by adding a KV to t_diagram.styleEx like this:

Code: [Select]
SPL=S_8FDEDC=E418F9,5D0B33:S_AB6EAF=B75579:
Here 8FDEDC are the first 6 bytes of the element guid. E418F9,5D0B33 is a comma separated list of attributes/operations to be suppressed. Again the first 6 chars of the guids are taken (obviously this is sufficient if you rely on EA's guid generation). A second element is append to the list with a colon as separator. So the above suppresses two attributes from one element and one operation from another (in my concrete case).

See also chap. 12.3.2 Features & Properties ... of my Inside book.

q.

Benny

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Thank you for your quick response!

regards

Benny