Option Explicit
ValidationMode = True
InteractiveMode = im_Abort
Dim mdl ' 定义当前的模型
'通过全局参数获得当前的模型
Set mdl = ActiveModel
If (mdl Is Nothing) Then
MsgBox "没有选择模型,请选择一个模型并打开."
ElseIf Not mdl.IsKindOf(PdLDM.cls_Model) Then
MsgBox "当前选择的不是一个逻辑模型(LDM)."
Else
ProcessFolder mdl
End If
Private Sub ProcessFolder(folder)
Dim package '定义package对象
for each package in folder.packages
Dim relationship '定义关系对象
for each relationship in package.relationships
'msgbox relationship.name
Dim joinItem '定义连接对象
for each joinItem in relationship.joins
relationship.name = "RS_" & joinItem.ChildAttribute.entity.name & "." & joinItem.ChildAttribute.name & "_" & joinItem.ParentAttribute.entity.name & "." & joinItem.ParentAttribute.name '重命名
next
next
next
msgbox "done"
End Sub
PowerDesigner脚本批量修改LDM中的关系(Relationship)名称
最新推荐文章于 2023-08-28 01:01:46 发布