在图EA中隐藏操作 [英] Hide Operations in Diagram EA
问题描述
我使用EA脚本创建模型。该模型由接口组成,每个接口都有操作。我还将这些接口添加到组成图中,如何在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.
是否可以通过EA中的某些设置进行操作,或者我需要做
Is it possible by some settings in EA or I need to do it programatically
谢谢
推荐答案
手动为单个元素进行操作是简单:
Doing it for single elements manually is simple:
- 从图中的上下文菜单中选择
功能/ ...可见性
- 在
操作可见性
中,单击自定义
- 选择您需要抑制的操作
- From the context menu in the diagram choose
Features/...Visibility
- In
Operation Visibility
clickCustom
- Choose the operations you need to suppress
现在,对于棘手的部分,如果您需要对许多图表进行操作一旦。信息存储在 t_diagram.StyleEx
中。这包含用分号分隔的条目列表。其中一个条目可能看起来像
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:;
现在 E4BB5A
是受影响的元素GUID。 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()
}
当然,您需要与现有的 SPL
条目合并,而不是简单地添加它们。但是你应该明白这个想法。
Of course you need to merge with existing SPL
entries rather than simply adding them. But you should get the idea.
这篇关于在图EA中隐藏操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!