原文:
http://www.cnblogs.com/xnxylf/p/3288718.html

由于PDM 的表中 Name 会默认=Code 所以很不方便, 所以需要将 StereoType 显示到表的外面来

打开[工具]->[显示属性](英文:Display Preferences) ->Content->Table->右边面板Columns框中 勾选: StereoType ,这样再在 StereoType中填入code字段相同内容就会显示在图形界面上了

使用说明: 在【Tools】-【Execute Commands】-【Edit/Run Script】 下。输入下面你要选择的语句即可,也可以保存起来,以便下次使用,后缀为.vbs。

需要注意的问题是:运行语句时必须在Module模式下,如果是导出报表时执行会出现错误提示。

1.Name转到Comment注释字段。一般情况下只填写NAME,COMMENT可以运行语句自动生成。

将该语句保存为name2comment.vbs

原地址的代码有一些格式上的错误,现已修正。

'把pd中那么name想自动添加到comment里面
'如果comment为空,则填入name;如果不为空,则保留不变,这样可以避免已有的注释丢失. 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   comment   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  trim(tab.comment)="" then'如果有表的注释,则不改变它.如果没有表注释.则把name添加到注释里面.
                        tab.comment   =   tab.name
                     end if  
                  Dim   col   '   running   column    
                  for   each   col   in   tab.columns   
                        if trim(col.comment)="" then '如果col的comment为空,则填入name,如果已有注释,则不添加;这样可以避免已有注释丢失.
                           col.comment=   col.name   
                        end if 
                  next    
            end   if    
      next    
  
      Dim   view   'running   view    
      for   each   view   in   folder.Views    
            if   not   view.isShortcut and trim(view.comment)=""  then    
                  view.comment   =   view.name    
            end   if    
      next    
  
      '   go   into   the   sub-packages    
      Dim   f   '   running   folder    
      For   Each   f   In   folder.Packages    
            if   not   f.IsShortcut   then    
                  ProcessFolder   f    
            end   if    
      Next    
end   sub 
 
2.将Comment内容保存到NAME中,comment2name.vbs 实习互换。语句为:
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    
  
Private   sub   ProcessFolder(folder)    
On Error Resume Next   
      Dim   Tab   'running     table    
      for   each   Tab   in   folder.tables    
            if   not   tab.isShortcut   then    
                  tab.name   =   tab.comment   
                  Dim   col   '   running   column    
                  for   each   col   in   tab.columns    
                  if col.comment="" then   
                  else  
                        col.name=   col.comment    
                  end if  
                  next    
            end   if    
      next    
  
      Dim   view   'running   view    
      for   each   view   in   folder.Views    
            if   not   view.isShortcut   then    
                  view.name   =   view.comment    
            end   if    
      next    
  
      '   go   into   the   sub-packages    
      Dim   f   '   running   folder    
      For   Each   f   In   folder.Packages    
            if   not   f.IsShortcut   then    
                  ProcessFolder   f    
            end   if    
      Next    
end   sub 

PowerDesigner中NAME和COMMENT的互相转换,需要执行语句的更多相关文章

  1. PowerDesigner中NAME和COMMENT的互相转换

    原文: http://www.cnblogs.com/yelaiju/archive/2013/04/26/3044828.html 由于PDM 的表中 Name 会默认=Code 所以很不方便, 所 ...

  2. PowerDesigner通过SQL语句生成PDM文件并将name和comment进行互相转换

    本篇文章主要介绍了PowerDesigner通过SQL语句生成PDM文件并将name和comment进行互相转换 超详细过程(图文),具有一定的参考价值,感兴趣的小伙伴们可以参考一下 1.软件准备 软 ...

  3. PowerDesigner设计Name和Comment 替换

    这两天在用powerdesigner设计数据库.一直以为name就是注释名字来着.后来生成sql语句 怎么就没有注释信息那. 后来看了半天才知道自己范2了. 通过各种信息查找.大多都是改databas ...

  4. PowerDesigner 逆向中 Name和Comment互换

    在使用PowerDesigner对数据库进行概念模型和物理模型设计时,一般在NAME或Comment中写中文,在Code中写英文.Name用来显 示,Code在代码中使用,但Comment中的文字会保 ...

  5. PowerDesigner中转换物理模型时的命名转换

    原文:PowerDesigner中转换物理模型时的命名转换 最近在使用PowerDesigner建模数据库,在使用中积累了一些遇到的问题和解决办法,记录下来,希望对遇到同样问题的朋友有所帮助. 早 期 ...

  6. PowerDesigner中在生成的数据库脚本中用name列替换comment列作为字段描述的方法

    1 PowerDesigner中在生成的数据库脚本中用name列替换comment列作为字段描述的方法如下, 依次打开Tools -- Execute Commands -- Run Script,运 ...

  7. PowerDesigner中逆向工程将数据库中comment赋值到name

    '------------------------------------------------------------ ' '脚本功能: ' PowerDesigner中逆向工程完成后,将数据库中 ...

  8. 使用PowerDesigner对NAME和COMMENT互相转换

    本文来自我的github pages博客http://galengao.github.io/ 即www.gaohuirong.cn 在使用PowerDesigner对数据库进行概念模型和物理模型设计时 ...

  9. PowerDesigner中创建Oracle表全过程记录

    本文记录如何在PowerDesigner中创建一个Oracle结构的表. 在进行本文阅读之前,需要在PowerDesigner进行 DBMS修改,DataBase创建,用户创建,表空间创建.   1. ...

随机推荐

  1. PROCEDURE_监测系统_告警信息存储过程—产生告警信息插入告警表

    create or replace procedure proc_alarmlog(in_id   in number, --采集器编码                                 ...

  2. js控制浏览器后退

    <script type="text/javascript"> window.history.forward(1); </script>

  3. 在Python3.5下安装和测试Scrapy爬网站

    1. 引言 Scrapy框架结构清晰,基于twisted的异步架构可以充分利用计算机资源,是爬虫做大的必备基础.本文将讲解如何快速安装此框架并使用起来. 2. 安装Twisted 2.1 同安装Lxm ...

  4. BNUOJ flower (搜索)

    春天到了,师大的园丁们又开始忙碌起来了. 京师广场上有一块空地,边界围成了一个多边形,内部被划分成一格一格的.园丁们想在这个多边形内的每一格内种植一些花. 现在请你帮忙计算一下一共最多可以种多少花. ...

  5. 如何使用Prism框架的EventAggregator在模块间进行通信

    目的 本文主要介绍如何使用Prism类库提供的事件机制在松耦合组件之间相互通信,Prism类库的事件机制建立在事件聚合服务之上,允许发布者和订阅者通过事件进行通信,不需要彼此之间引用. 事件聚合 Ev ...

  6. 虚拟机比较(wiki)

    https://zh.wikipedia.org/wiki/%E8%99%9B%E6%93%AC%E6%A9%9F%E5%99%A8#.E8.99.9B.E6.93.AC.E6.A9.9F.E5.99 ...

  7. .net 反编译利器 dnspy

    Binaries Latest release: https://github.com/0xd4d/dnSpy/releases Latest build (possibly unstable): h ...

  8. ListView.setOnItemClickListener无效

    如果ListView中的单个Item的view中存在checkbox,button等view,会导致ListView.setOnItemClickListener无效, 事件会被子View捕获到,Li ...

  9. codecomb 2093【牛宫】

    题目描述 Description Hzgd神牛准备给自己盖一座很华丽的宫殿.于是,他看中了一块N*M的矩形空地.空地中每个格子都有自己的海拔高度.胡张想让他的宫殿的平均海拔在海平面之上(假设海平面的高 ...

  10. Generate Parentheses 解答

    Question Given n pairs of parentheses, write a function to generate all combinations of well-formed ...