最後通過創建EA腳本得到了解決方案。感覺自由使用和增強它:)
!INC Local Scripts.EAConstants-JScript
function OnProjectBrowserScript()
{
// Show the script output window
Repository.EnsureOutputVisible("Script");
var treeSelectedType = Repository.GetTreeSelectedItemType();
switch (treeSelectedType)
{
case otElement: // if select table
{
removeInitial(Repository.GetContextObject());
break;
}
case otPackage: // if select package containing table
{
var selectedObject as EA.Element;
selectedObject = Repository.GetContextObject();
for (var i = 0 ; i < selectedObject.Elements.Count ; i++)
{
removeInitial(selectedObject.Elements.GetAt(i));
}
break;
}
default:
{
// Error message
Session.Prompt("This script does not support items of this type.", promptOK);
}
}
}
function removeInitial(selectedObject)
{
for (var i = 0 ; i < selectedObject.Attributes.Count; i++)
{
var attrib as EA.Attribute;
attrib = selectedObject.Attributes.GetAt(i);
attrib.Default = "";
attrib.Update();
}
Session.Output("finished updating " + selectedObject.Name);
}
OnProjectBrowserScript();