gpt4 book ai didi

enterprise-architect - 有没有办法在 Enterprise Architect 中删除多个标记值?

转载 作者:行者123 更新时间:2023-12-02 01:57:09 27 4
gpt4 key购买 nike

我的元素有 10 个或更多标记值,而不是一次删除一个,有没有办法同时删除它们?

最佳答案

正如 Uffe 指出的那样,您可以使用脚本来完成此操作。有关 EA 脚本的更多信息,请参阅 the EA User Guide here .

这里的示例是一个函数,用于删除 VBScript 中单个元素上按名称标记的所有实例:

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

关于enterprise-architect - 有没有办法在 Enterprise Architect 中删除多个标记值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19388231/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com