Option Explicit
Validationmode = True
Interactivemode = Im_batch
Dim MDL ' 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 (Pdcdm.cls_model) Then ' if it's processing PDM, here's Pdpdm.cls_model
MsgBox "The current model isn't an physical Data model."
Else
ProcessFolder MDL
End If
' This routine copy name to comment for each table, each column and each view
' of the current folder
Private Sub ProcessFolder (folder)
Dim ref ' objects to process
For each ref in Folder.relationships
If not Ref.isshortcut then
If InStr (LCase (Ref.code), "Relationship_") =1 Then
Ref.code=ref.entity1.name+ "2" +ref.entity2.name
Ref.name=ref.code
End If
End If
Next
' Recursive traversal of subfolders
Dim F ' Sub-folder
For each F in folder. Packages
If not F.isshortcut then
ProcessFolder F
End If
Next
End Sub
Rename all relationships starting with RELATONSHIP_ in the CDM to avoid database generation because of duplicate relationship name errors