`

PowerDesigner中name和comment互換

阅读更多
1 PowerDesigner中批量根据对象的name生成comment的脚本

执行方法:Open PDM -- Tools -- Execute Commands -- Run Script

Option Explicit
ValidationMode = True
InteractiveMode = im_Batch

Dim mdl 'the current model

'get the current active model
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

'This routine copy name into code for each table, each column and each view
'of the current folder
Private sub ProcessFolder(folder)
Dim Tab 'running table
for each Tab in folder.tables
if not tab.isShortcut then
tab.comment = tab.name
Dim col 'running column
for each col in tab.columns
col.comment= col.name
next
end if
next

Dim view 'running view
for each view in folder.Views
if not view.isShortcut then
view.comment = view.name
end if
next

'go into the sub-packages
Dim f 'running folder
For Each f In folder.Packages
if not f.IsShortcut then
ProcessFolder f
end if
Next
end sub


2 PowerDesigner中逆向工程将数据库中comment脚本赋值到PDM的name

执行方法:Open PDM -- Tools -- Execute Commands -- Run Script

Option Explicit
ValidationMode = True
InteractiveMode = im_Batch

Dim mdl 'the current model

'get the current active model
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

'This routine copy name into code for each table, each column and each view
'of the current folder
Private sub ProcessFolder(folder)

Dim Tab 'running table
for each Tab in folder.tables
if not tab.isShortcut then
if len(tab.comment) <> 0 then
tab.name = tab.comment
end if
On Error Resume Next
Dim col 'running column
for each col in tab.columns
if len(col.comment) <>0 then
col.name =col.comment
end if
On Error Resume Next
next
end if
next
end sub
分享到:
评论

相关推荐

    PowerDesigner 中name和comment 互换脚本

    "PowerDesigner 中name和comment 互换脚本"这个主题涉及到的是在PDM中,如何通过编写VBS(Visual Basic Script)脚本来实现模型对象的name属性和comment属性的交换。 PowerDesigner中的name属性通常用于定义对象的...

    PowerDesigner中的name和comment互换

    在PowerDesigner这款数据建模和设计工具中,name和comment的互换是一个重要的操作...通过理解和实践PowerDesigner中的name和comment互换脚本,可以进一步加深对数据模型结构和属性的理解,提升处理数据模型的专业能力。

    powerdesigner_comment转name_name转comment

    描述中提到的“可以很好的实现comment和name之间的相互转换,针对mysql数据库表的设计很方便”,意味着这个功能特别适用于MySQL数据库。MySQL是广泛使用的开源关系型数据库管理系统,它的灵活性和高性能使其成为许多...

    PowerDesigner 把name写到Comment中 和 把Comment写到name中 pd7以后版本可用

    标题中的“PowerDesigner 把name写到Comment中 和 把Comment写到name中 pd7以后版本可用”指的是一项在PowerDesigner中操作模型属性的方法。PowerDesigner是一款强大的数据建模工具,广泛应用于数据库设计和逆向工程...

    VB Scripts.zip

    在这个"VB Scripts.zip"压缩包中,包含两个VBScript文件——A_name2comment.vbs和A_comment2name.vbs,它们显然与数据库设计工具PowerDesigner有关。PowerDesigner是一款强大的数据建模工具,它允许用户创建概念数据...

Global site tag (gtag.js) - Google Analytics