`

PowerDesigner中显示name, code,comment的解决方法 修正脚本,执行不会重复添加comment

阅读更多
  1. Option   Explicit   
  2. ValidationMode   =   True   
  3. InteractiveMode   =   im_Batch  
  4. Dim   mdl   '   the   current   model  
  5. '   get   the   current   active   model   
  6. Set   mdl   =   ActiveModel   
  7. If   (mdl   Is   Nothing)   Then   
  8.       MsgBox   "There   is   no   current   Model "   
  9. ElseIf   Not   mdl.IsKindOf(PdPDM.cls_Model)   Then   
  10.       MsgBox   "The   current   model   is   not   an   Physical   Data   model. "   
  11. Else   
  12.       ProcessFolder   mdl   
  13. End   If  
  14. Private   sub   ProcessFolder(folder)   
  15. On Error Resume Next  
  16.       Dim   Tab   'running     table   
  17.       for   each   Tab   in   folder.tables   
  18.             if   not   tab.isShortcut   then   
  19.                   tab.name   =   tab.comment  
  20.                   Dim   col   '   running   column   
  21.                   for   each   col   in   tab.columns   
  22.                   if col.comment<>"" and instr( col.name,"*")=0  then  
  23.                     
  24.                         col.name= col.name & " * " &  col.comment   
  25.                   end if  
  26.                   next   
  27.             end   if   
  28.       next  
  29.       Dim   view   'running   view   
  30.       for   each   view   in   folder.Views   
  31.             if   not   view.isShortcut   then   
  32.                if view.comment<>"" and instr( view.name,"*")=0  then  
  33.                   view.name   = view.name & " * " &  view.comment   
  34.                end if  
  35.             end   if   
  36.       next  
  37.       '   go   into   the   sub-packages   
  38.       Dim   f   '   running   folder   
  39.       For   Each   f   In   folder.Packages   
  40.             if   not   f.IsShortcut   then   
  41.                   ProcessFolder   f   
  42.             end   if   
  43.       Next   
  44. end   sub  

在PD上按下:Ctr+shift + X 后,把以上VBS脚本,复制到上面运行。经改良后不会,执行多次不会重复添加描述。

 

转:http://blog.csdn.net/jockey/article/details/44682855

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics