Reproduced from: http://blog.csdn.net/xuxile/article/details/49817385
Execution method: Open PDM – Tools – Execute Commands – Run Script
Vb script code:
- Option Explicit
- InteractiveMode= im_Batch
- Dim mdl’the current model
- ‘get the current active model
- Set mdl= ActiveModel
- If (mdlIsNothing) 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 span>
- ‘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 len(tab.comment)<>0then
- tab.name= tab.comment
- end if
- On Error Resume Next
- Dimcol’runningcolumn
- for each col in tab.columns
- if len(col.comment)<>0then
- col.name=col.comment
- end if
- On Error Resume Next
- < span style="margin:0px; padding:0px; border:none; color:black; background-color:inherit">next
- end if
- next
- end sub
< li style="border-style:none none none solid; border-left-width:3px; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; line-height:18px; margin :0px!important; padding:0px 3px 0px 10px!important; background-color:rgb(248,248,248)"> ValidationMode= True