powerdesigner comment与name互转

tools --> Excute Commands --> Edit/Run Script


comment转name:

OptionExplicit

ValidationMode =True

InteractiveMode = im_Batch

Dimmdl'the current model

'get the current active model

Setmdl = ActiveModel

If(mdlIsNothing)Then

MsgBox"There is no current Model"

ElseIfNotmdl.IsKindOf(PdPDM.cls_Model)Then

MsgBox"The current model is not an Physical Data model."

Else

ProcessFolder mdl

EndIf

'This routine copy name into code for each table, each column and each view

'of the current folder

PrivatesubProcessFolder(folder)

DimTab'running table

foreachTabinfolder.tables

ifnottab.isShortcutthen

iflen(tab.comment) <>0then

tab.name = tab.comment

endif

OnErrorResumeNext

Dimcol'running column

foreachcolintab.columns

iflen(col.comment) <>0then

col.name =col.comment

endif

OnErrorResumeNext

next

endif

next

endsub

name转comment:


OptionExplicit

ValidationMode =True

InteractiveMode = im_Batch

Dimmdl'the current model

'get the current active model

Setmdl = ActiveModel

If(mdlIsNothing)Then

MsgBox"There is no current Model"

ElseIfNotmdl.IsKindOf(PdPDM.cls_Model)Then

MsgBox"The current model is not an Physical Data model."

Else

ProcessFolder mdl

EndIf

'This routine copy name into code for each table, each column and each view

'of the current folder

PrivatesubProcessFolder(folder)

DimTab'running table

foreachTabinfolder.tables

ifnottab.isShortcutthen

tab.comment = tab.name

Dimcol'running column

foreachcolintab.columns

col.comment= col.name

next

endif

next

Dimview'running view

foreachviewinfolder.Views

ifnotview.isShortcutthen

view.comment = view.name

endif

next

'go into the sub-packages

Dimf'running folder

ForEachfInfolder.Packages

ifnotf.IsShortcutthen

ProcessFolder f

endif

Next

endsub

你可能感兴趣的:(powerdesigner comment与name互转)