📄 comment2name.vbs
字号:
'功能:
'**表示主键字段 *表示非空字段
'每列加上序号(有时不同的字段comment可能相同)
Option Explicit
ValidationMode = True
InteractiveMode = im_Batch
Dim mdl
Set mdl = ActiveModel
If (mdl Is Nothing) Then
MsgBox "There is no current Model"
ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
MsgBox "The current model is not an Physical Data model."
Else
ProcessFolder mdl
End If
Private sub ProcessFolder(folder)
Dim Tab,rr
rr=0
for each Tab in folder.tables
rr=rr+1
if not tab.isShortcut then
if (not isnull(tab.comment)) and (trim(tab.comment)<>"") then
tab.name = tab.comment
end if
Dim col,r
r=0
for each col in tab.columns
r=r+1
if (not isnull(col.comment)) and (trim(col.comment)<>"") then
col.name=col.comment
'**表示主键字段 *表示非空字段
if (Col.Mandatory="True") then
col.name="*"+col.name
col.code="*"+col.code
end if
if (Col.Primary="True") then
col.code="*"+col.code
end if
end if
next
end if
next
Dim view
for each view in folder.Views
if not view.isShortcut then
if (not isnull(view.comment)) and (trim(view.comment)<>"") then
view.name = view.comment
end if
end if
next
end sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -