Powerdesigner database inversely generates PDM to display Chinese
Tools- > Execute Commands- > Edit/Runscript...
Execute the following script, and when Powerdesigner generates PDM from the database in reverse, the NAME displays in Chinese.
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 tab.comment = "" then
Else
Tab.name=tab.name+ "(" + tab.comment+ ")"
On error resume next
End if
Dim col 'running column
For each col in tab.columns
If col.comment= "" then
'MsgBox' table "+ tab.name+" column "+ col.name +" No comment "
Else
Col.name=col.name+ "(" + col.comment+ ")"
On error resume next
End if
Next
End if
Next
Dim view 'running view
For each view in folder.Views
If not view.isShortcut then
If view.comment= "" then
MsgBox "View" + view.name + "No comment"
Else
View.name=view.name+ "(" + view.comment+ ")"
On error resume next
End if
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