PowerDesigner脚本:删除无用的Data Items

王朝mssql·作者佚名  2006-12-17
窄屏简体版  字體: |||超大  

PowerDesigner脚本:删除无用的Data Items

PowerDesigner脚本:删除无用的Data Items '*****************************************************************************

'文件:Delete useless data items.vbs

'版本:1.0

'版权:floodzhu (floodzhu@hotmail.com),2005.1.6

'功能:遍历概念模型,把无用的Data Items删除。

'*****************************************************************************

dim index

index = 0

dim model 'current model

set model = ActiveModel

If (model Is Nothing) Then

MsgBox "当前没有活动的模型。"

ElseIf Not model.IsKindOf(PdCDM.cls_Model) Then

MsgBox "当前模型不是概念模型。"

Else

View model

MsgBox index & "个无用字段被删除。"

End If

'*****************************************************************************

'函数:View

'功能:递归遍历

'*****************************************************************************

sub View(folder)

dim item

for each item in folder.DataItems

if not item.IsShortCut then

Visit item

end if

next

'对子目录进行递归

dim subFolder

for each subFolder in folder.Packages

View subFolder

next

end sub

'*****************************************************************************

'函数:Visit

'功能:处理节点

'*****************************************************************************

sub Visit(node)

if node.UsedBy="" then

node.delete

index = index + 1

end if

end sub

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航