[英]How to get exactly type of element in state machine diagram Enterprise Architect
I want to find exactly type of element in StateMachine diagram (Initial State, Choice, EntryPoint, ExitPoint...) using EA.Automation interface. 我想使用EA.Automation接口在StateMachine图中找到元素的确切类型(初始状态,选择,EntryPoint,ExitPoint ...)。 see the pictures below:
参见下面的图片:
I used the code snippet below: 我使用了下面的代码片段:
void GetRealTypeOfNodes(EA.Diagram diagram)
{
var objects = diagram.DiagramObjects;
foreach(EA.DiagramObject obj in objects)
{
EA.Element elem = Repository.GetElementByID(obj.ElementID);
MessageLogger.log(elem.Type, obj.ObjectType.ToString(), elem.Name, obj.GetType().ToString());
}
}
but what I get is: 但是我得到的是:
Could you help me to get what exactly I want? 您能帮我得到我想要的东西吗?
You need to inspect Element.SubType
: 您需要检查
Element.SubType
:
This might be documented somewhere in EA's help, or it might not. 这可能会在EA帮助的某个地方记录下来,也可能没有。 Issue the query
发出查询
SELECT name, ntype FROM t_object
in the SQL scratch pad. 在SQL暂存器中。 This will return the
subType
in ntype
and you can find out missing ones. 这将返回
subType
的ntype
,你可以找到失踪者。
According to my Inside book, StateNode
s can take the values 3, 4, 10, 11, 12, 13, 14, 100 and 101 as SubType
. 根据我的《内部书》,
StateNode
可以将值StateNode
和101用作SubType
。 But I have not listed, which is which. 但是我没有列出,这是哪个。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.