Vbscript &引用;请在所有图表中找到“;作为VB代码

Vbscript &引用;请在所有图表中找到“;作为VB代码,vbscript,enterprise-architect,Vbscript,Enterprise Architect,我试图通过VBScript在模型中的所有图表中找到一个元素(在Enterprise Architect中)。 该操作需要哪个命令? 如何查找元素的所有相关链接?最好的方法是使用SQL查询获取所有图表的列表。 使用类似 select distinct d.diagram_ID from t_diagramobjects d where d.Object_ID = [insert element id here] 将此查询与Repository.SQLQuery()一起使用,以获得xml格式的所有

我试图通过VBScript在模型中的所有图表中找到一个元素(在Enterprise Architect中)。 该操作需要哪个命令?
如何查找元素的所有相关链接?

最好的方法是使用SQL查询获取所有图表的列表。 使用类似

select distinct d.diagram_ID from t_diagramobjects d
where d.Object_ID = [insert element id here]
将此查询与
Repository.SQLQuery()
一起使用,以获得xml格式的所有Diagramid的列表

为了从结果中获取数据,您必须使用与此类似的函数:

Public Function convertQueryResultToArray(xmlQueryResult)
    Dim arrayCreated
    Dim i 
    i = 0
    Dim j 
    j = 0
    Dim result()
    Dim xDoc 
    Set xDoc = CreateObject( "MSXML2.DOMDocument" )
    'load the resultset in the xml document
    If xDoc.LoadXML(xmlQueryResult) Then        
        'select the rows
        Dim rowList
        Set rowList = xDoc.SelectNodes("//Row")

        Dim rowNode 
        Dim fieldNode
        arrayCreated = False
        'loop rows and find fields
        For Each rowNode In rowList
            j = 0
            If (rowNode.HasChildNodes) Then
                'redim array (only once)
                If Not arrayCreated Then
                    ReDim result(rowList.Length, rowNode.ChildNodes.Length)
                    arrayCreated = True
                End If
                For Each fieldNode In rowNode.ChildNodes
                    'write f
                    result(i, j) = fieldNode.Text
                    j = j + 1
                Next
            End If
            i = i + 1
        Next
    end if
    convertQueryResultToArray = result
End Function
一旦有了diagramID,就可以使用
Repository.GetDiagramByID()
来获取实际的图表


您最初在模型中循环所有图表的方法将非常缓慢,即使对于小型模型也是如此。

到目前为止,我在EA帮助中没有找到命令。。。我可以在所有图表上使用for循环来获得“在所有图表中查找”,但我不知道如何找到它的相关链接。