从 Python 中提取用例的关键字

Extract Use Case's Keywords from Python

来自 Python 通过 win32com 我从我的 Enterprise Architect 项目中提取了所有用例:

use_cases = EA.GetElementSet("select * from t_object where Object_Type='UseCase'", 2);

通过循环 use_cases,我想获得用例的 "Keywords"。 通过尝试调用例如uc.pdata5 我得到一个属性错误。

如何获取?

PData5是数据库中存储此信息的字段。

但是,如果您通过 API 获得用例,则您拥有 EA.Element 类型的元素,这些元素记录在 manual

在这种情况下,您需要使用 uc.Tag。来自手册:

Tag

String

Notes: Read/Write Corresponds to the Keywords field in the Enterprise Architect user interface.