Power Designer comment and name Huzhuan (vbs script)

Share reprint: https: //blog.csdn.net/u010216641/article/details/48712503 utm_source = blogxgwz1?

PowerDesigner case conversion table structure and fields

Steps:

1) enter PowerDesigner, open a PDM, in the menu bar to find: Tools - Excute Commands - Edit / Run Script, and then open the name2comment.vbs script;

2) or just press Ctrl + Shift + X window to bring up the execution of the script, the script input name2content.vbs

Executing code as follows (name2comment.vbs):

1) Copy the name to comment Chinese Chinese

The Option  Explicit   
ValidationMode = True   
InteractiveMode = im_Batch  
 Dim mdl ' current model   
' Get the current model of   
the Set mdl = ActiveModel  
 the If (mdl Is is  Nothing ) the Then   
   MsgBox  " does not open a model "  
ElseIf  Not mdl.IsKindOf (PdPDM.cls_Model) the Then   
   MsgBox  " The current model not a PDM "  
Else   
' invocation handler   
   ProcessFolder mdl  
 End  the If     
' handler invoked   
Private Sub ProcessFolder (Folder)  
    Dim  the Tab  ' to process the table   
   for  each  the Tab  in folder.Tables  
     ' IF Not Tab.isShortcut the then   
        ' Tab.code tab.name =   
        ' table processing, a prefix is added in front, lowercase   
        the Tab .name = the UCase ( the Tab .name)  
         the Tab .code = the UCase ( the Tab .code)  
         Tab .comment = Tab .name 
          Dim COL ' column to be addressed   
         for  each COL in  the Tab.Columns  
             ' column names and code all lower case, large poetry the UCase   
            col.code = the UCase (col.code)   
            col.name = the UCase (col.name)   
       'copied into the comment column name' col.comment
= col.name Next ' End IF Next ' process view ' Dim view' running view ' for each view in folder.Views ' IF Not view.isShortcut the then ' view.code = view.name ' End IF ' Next ' the recursive-Packages entering Sub Dim f ' sub folder For Each f In folder.Packages if not f.IsShortcut then ProcessFolder f end if Next end sub

2) comment turn name Chinese

The Option  Explicit   
ValidationMode = True   
InteractiveMode = im_Batch  
 Dim mdl ' current model   
' Get the current model of   
the Set mdl = ActiveModel  
 the If (mdl Is is  Nothing ) the Then   
   MsgBox  " does not open a model "  
ElseIf  Not mdl.IsKindOf (PdPDM.cls_Model) the Then   
   MsgBox  " The current model not a PDM "  
Else   
' invocation handler   
   ProcessFolder mdl  
 End  the If     
' handler invoked   
Private Sub ProcessFolder (Folder)  
    Dim  the Tab  ' to process the table   
   for  each  the Tab  in folder.Tables  
     ' IF Not Tab.isShortcut the then   
        ' Tab.code tab.name =   
        ' table processing, a prefix is added in front, lowercase   
        the Tab .name = the UCase ( the Tab .name)  
         the Tab .code = the UCase ( the Tab .code)  
         Tab .comment = Tab .name 
          Dim COL ' column to be addressed   
         for  each COL in  the Tab.Columns  
             ' column names and code all lower case, large poetry the UCase   
            col.code = the UCase (col.code)   
            col.name = the UCase (col.name)   
       'column name is copied to the comment name' col.name = col.comment
Next ' End IF Next ' process view ' Dim view' running view ' for each view in folder.Views ' IF Not view.isShortcut the then ' view.code = view.name ' End IF ' Next ' the recursive-Packages entering Sub Dim F ' sub folder For Each f In folder.Packages if not f.IsShortcut then ProcessFolder f end if Next end sub

 

Guess you like

Origin www.cnblogs.com/blogslee/p/11611309.html