1. 批量设置
2. 脚本
Option Explicit
ValidationMode = True
InteractiveMode = im_Batch
Dim mdl 'the current model
' get the current active model
Set mdl = ActiveModel
If (mdl Is Nothing) ThenMsgBox"There is no current Model "
ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) ThenMsgBox"The current model is not an Physical Data model. "
ElseProcessFolder mdl
End If
' This routine copy name into comment for each table, each column and each view
' of the current folderPrivate sub ProcessFolder(folder)Dim Tab'running?? table?for each Tab in folder.tablesif not tab.isShortcut thenif trim(tab.comment)="" then'如果有表的注释,则不改变它.如果没有表注释.则把name添加到注释里面.tab.comment = tab.nameend ifDim col' running column?for each col in tab.columnsif trim(col.comment)="" then'如果col的comment为空,则填入name,如果已有注释,则不添加;这样可以避免已有注释丢失.col.comment= col.nameend ifnext end ifnext Dim view'running viewfor each view in folder.Viewsif not view.isShortcut and trim(view.comment)="" thenview.comment = view.name end if next' go into the sub-packages?Dim f' running folder?For Each f In folder.Packagesif not f.IsShortcut thenProcessFolder fend ifNext
end sub
3. 结果
好了