The methods used in PowerDesigner are:
Powerdesigner->tools->execute Commands->edit/run Scripts
Code one: copy the characters in name to comment
Option Explicit Validationmode=True Interactivemode=Im_batchdim MDL'The current model'get the current active modelSet 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 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 folderPrivate Sub ProcessFolder (folder) Dim Tab'Running Table forEach TabinchFolder.tablesifNot Tab.isshortcut then tab.comment=tab.name Dim Col'Running Column forEach colinchtab.columns col.comment=col.name Next EndifNext Dim View'Running View forEach viewinchfolder. viewsifNot View.isshortcut then view.comment=View.name EndifNext'go into the sub-packagesDim F'Running FolderFor each f in folder. PackagesifNot F.isshortcut then ProcessFolder F endifNext End Sub
Code two: copy the characters from the comment to the name
Option Explicit Validationmode=True Interactivemode=Im_batchdim MDL'The current model'get the current active modelSet 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 isn't an physical Data model."Else processfolder MDL End ifprivate Sub ProcessFolder (folder) on Error Resume Next Dim Tab
'Running Table forEach TabinchFolder.tablesifNot Tab.isshortcut then Tab.name=tab.comment Dim Col'Running Column forEach colinchTab.columnsifCol.comment="" ThenElseCol.name=Col.comment EndifNext EndifNext Dim View'Running View forEach viewinchfolder. viewsifNot View.isshortcut then View.name=View.comment EndifNext'go into the sub-packagesDim F'Running FolderFor each f in folder. PackagesifNot F.isshortcut then ProcessFolder F endifNext End Sub
PowerDesigner sync name to Comment and sync Comment to name