首先打开PDM,tools->execute commands->edit/run script
运行以下脚本,将name拷贝为comment
- OptionExplicit
- ValidationMode=True
- InteractiveMode=im_Batch
-
- Dimmdl'thecurrentmodel
-
- 'getthecurrentactivemodel
- Setmdl=ActiveModel
- If(mdlIsNothing)Then
- MsgBox"ThereisnocurrentModel"
- ElseIfNotmdl.IsKindOf(PdPDM.cls_Model)Then
- MsgBox"ThecurrentmodelisnotanPhysicalDatamodel."
- Else
- ProcessFoldermdl
- EndIf
-
- 'Thisroutinecopynameintocodeforeachtable,eachcolumnandeachview
- 'ofthecurrentfolder
- PrivatesubProcessFolder(folder)
- DimTab'runningtable
- foreachTabinfolder.tables
- ifnottab.isShortcutthen
- tab.comment=tab.name
- Dimcol'runningcolumn
- foreachcolintab.columns
- col.comment=col.name
- next
- endif
-
- next
- endsub
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
tab.comment=tab.name
Dim col ' running column
for each col in tab.columns
col.comment=col.name
next
end if
next
end sub
然后在database->generate database->options->table&column中分别选中table和column的coment,导出表的时候,即可导出comment