Ragnar
Ragnar

Reputation: 665

Hide Operations in Diagram EA

I create a model using EA Scripting. The model consists of interfaces and each interface has operations. I also add these interfaces in a composition diagram , how can I not show the operations in diagram in EA.

Is it possible by some settings in EA or I need to do it programatically

Thanks

Upvotes: 0

Views: 1274

Answers (1)

qwerty_so
qwerty_so

Reputation: 36305

Doing it for single elements manually is simple:

  • From the context menu in the diagram choose Features/...Visibility
  • In Operation Visibility click Custom
  • Choose the operations you need to suppress

Now for the tricky part, if you need to do that for many diagrams at once. The information is stored in t_diagram.StyleEx. This contains a semicolon separated list of entries. One of those entries might look like

SPL=S_E4BB5A=69A30E,2A49EF:;

Now E4BB5A are the first 6 nibbles of the element GUID which is affected. 69A30E and 2A49EF are those of attributes or operations which shall be suppressed. So in order to suppress an operation on all diagrams you need to do the following:

oGuid = operation.methodGuid.substring(1,6) // get "69A30E" from "{69A30E-..."
eGuid = element.elementGuid.substring(1,6) // E4BB5A
sup = "SPL=S_" + eGuid + "=" + oGuid + ":;"
for dia in allDiagramsInRepos { // you need to build that on your own
  dia.styleEx += sup
  dia.update()
}

Of course you need to merge with existing SPL entries rather than simply adding them. But you should get the idea.

Upvotes: 1

Related Questions