3

10 個以上のタグ付き値を持つ要素があり、一度に 1 つずつ削除するのではなく、これらを同時に削除する方法はありますか?

4

3 に答える 3

2

Uffe が指摘したように、スクリプトを使用してこれを行うことができます。EA スクリプトの詳細については、こちらの EA ユーザー ガイドを参照してください。

例として、VBScript の 1 つの要素にある名前でタグ付けされた のすべてのインスタンスを削除する関数を次に示します。

function deleteTaggedValueForElement( theElement, theTagName )

    dim i
    if not theElement is nothing and Len( theTagName ) > 0 then
        dim tags as EA.Collection
        set tags = theElement.TaggedValues

        for i = tags.Count - 1 to 0 step -1 
            dim theTag as EA.TaggedValue
            set theTag = tags.GetAt( i )
            if theTag.Name = theTagName then
                call theElement.TaggedValues.DeleteAt( i, FALSE )
            end if
        next
    end if

end function

sub main
    dim theTagName
    dim theQuery
    dim theElements as EA.Collection

    theTagName = "MyTag"
    theQuery= "SELECT t_object.Object_ID FROM t_objectproperties INNER JOIN t_object ON t_objectproperties.Object_ID = t_object.Object_ID  WHERE t_objectproperties.Property='" & theTagName & "'"
    set theElements = Repository.GetElementSet( theQuery, 2 )

    dim theElement
    for each theElement in theElements 
        call deleteTaggedValueForElement( theElement, theTagName )
    next

end sub

main
于 2015-04-17T07:58:41.790 に答える
0

GUI ではなく、スクリプトを作成する必要があります。

タグは要素のTaggedValuesコレクションに保存されます。ヒントは、エントリを削除するときにコレクションを逆方向にトラバースすることです。

于 2013-10-16T06:53:39.717 に答える
0

これが現在不可能であることを確認する EA ヘルプ ページがあります。

このプロパティを削除するには、要素の [プロパティ] ダイアログを開き、[タグ付き値] タブに移動して、アイテムを手動で削除する必要があります。現在、複数の要素からタグを同時に削除するショートカットはありません。

http://www.sparxsystems.com/enterprise_architect_user_guide/10/modeling_basics/addtaggedvalues.html

于 2014-02-17T10:58:10.580 に答える