powerdesign导出name作为comment

阅读更多
powerdesign导出name作为comment

博客分类: 开发工具
VB脚本
首先打开PDM,tools->execute commands->edit/run script
运行以下脚本,将name拷贝为comment
Vb代码 
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

你可能感兴趣的:(脚本,vb)