在pd里面运行下面这段代码
'******************************************************************************
'* File: name2comment.vbs
'* Purpose: Database generation cannot use object names anymore
' in version 7 and above.
' It always uses the object codes.
'
' In case the object codes are not aligned with your
' object names in your model, this script will copy
' the object Name onto the object comment for
' the Tables and Columns.
'
'* Title: 把对象name拷入comment属性中
'* Version: 1.0
'* 执行方法:PD11 -- Open PDM -- Tools -- Execute Commands -- Run Script
'******************************************************************************
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
if tab.comment ="" then
else
tab.name=tab.name+"("+tab.comment+")"
on error resume next
end if
Dim col ' running column
for each col in tab.columns
if col.comment="" then
' MsgBox "表"+tab.name+"列"+col.name +"没有comment"
else
col.name=col.name+"("+col.comment+")"
on error resume next
end if
next
end if
next
Dim view 'running view
for each view in folder.Views
if not view.isShortcut then
if view.comment="" then
MsgBox "视图"+view.name +"没有comment"
else
view.name=view.name+"("+view.comment+")"
on error resume next
end if
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中翻转生成PDM图时把Name属性变成注释(转)的更多相关文章

  1. idea 中如何生成类图

    前言:记录一下 idea 中如何生成类图,毕竟类图在开发或看源码时用得特别多. 推荐博客:https://blog.csdn.net/zhangle1hao/article/details/78804 ...

  2. chart.js插件生成折线图时数据普遍较大时Y轴数据不从0开始的解决办法[bubuko.com]

    chart.js插件生成折线图时数据普遍较大时Y轴数据不从0开始的解决办法,原文:http://bubuko.com/infodetail-328671.html 默认情况下如下图 Y轴并不是从0开始 ...

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

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

  4. 在PowerDesigner中自动生成sqlserver字段备注

    在PowerDesigner中自动生成sqlserver字段备注 PowerDesigner是数据库设计人员常用的设计工具,但其自生默认生成的代码并不会生成sqlserver数据库的字段备注说明.在生 ...

  5. Eclipse中自动生成get/set时携带注释给get/set

    Eclipse中自动生成get/set时携带注释给get/set   编码的时候通常要用到 JavaBean ,而在我们经常把注释写在字段上面,但生成的Get/Set方法不会生成,通过修改Eclips ...

  6. PowerDesigner中CDM和PDM如何定义外键关系

    有A.B两张表(实体),各自有id作为主键,两表是一一对应关系.但略有不同: A表一条记录可以对应0或1条B表记录,B表一条记录必须对应唯一条A表记录. 这样的关系如何在CDM或PDM中定义? 在最后 ...

  7. Yarn中如何生成状态机图

    原文 http://xiguada.org/yarn_state_picture/ 在Hadoop2.0系列的版本里,采用了状态机的方式处理ResourceManager,NodeManager,Ma ...

  8. PowerDesigner中如何生成主键和自增列

    1.SQL Server版本: 第一步,首先要建立与数据库的连接,方法较多,这里举个例子: http://www.cnblogs.com/netsql/archive/2010/05/17/17375 ...

  9. C#中如何生成矢量图

    主要的功能就是使用C#画矢量图,然后导出到Word.Excel.Powerpoint中,并且能够再次被编辑.以下是解决过程: 首先应该确定在Office文档中可编辑图形使用的格式:学习了相关资料,了解 ...

随机推荐

  1. Win7如何设置多用户同时远程登录

    有时候服务器是Win7系统的时候,远程登录桌面时,即使登录的是不同的管理账号,还是会把远程登录的人给记下来.即不同的账号只能同时存在一个会话窗.本文教大家如果设置Win7让两个账号的两会话同时存在,且 ...

  2. 安全预警-防范新型勒索软件“BlackRouter”

    近期,出现一种新型勒索软件“BlackRouter”,开发者将其与正常软件恶意捆绑在一起,借助正常软件的下载和安装实现病毒传播,并以此躲避安全软件的查杀.目前,已知的被利用软件有AnyDesk工具(一 ...

  3. javascript 大中小括号的区别

    小括号 JavaScript中小括号有五种语义 语义1,函数声明时参数表 function func(arg1,arg2){ // ... } 语义2,和一些语句联合使用以达到某些限定作用 // 和f ...

  4. return 返回值的问题

    def yue(): print("1. 打开手机") print("2. 打开陌陌") print("3. 找个漂亮的小姐姐") prin ...

  5. redis 配置文件redis.conf

    daemonize yes #---默认值no,该参数用于定制redis服务是否以守护模式运行.--- pidfile /var/run/redis.pid #默认值/var/run/redis.pi ...

  6. ubuntu配置默认python版本并安装pip

    ubuntu 16.04本身是自带python的,他本身是自带2.X和3.X,两个版本,默认的是2.X.这里记录一下如果在版本间切换以及如何把python版本切换到3.X下的方法. 1.查看Ubunt ...

  7. SDWC补题计划

    2018的寒假去了SD的冬令营,因为一班二班难度悬殊,对我很不友好,几乎什么也没学会,但是我把两个班的课件都存了下来,现在慢慢把两个班的例题以及课后题都补一补(毕竟冬令营的钱不能白花). 这些题目横跨 ...

  8. ABAP知识点提纲

    编号 课程名称 课程内容 预计课时 10.1.1~10.1.2 SAP系统与产品集 1. 了解SAP常见产品 ,了解SAP系统架构 1 10.1.3~10.1.4 导航界面与用户界面 1. 了解SAP ...

  9. 列表中不限制宽度,hover时,字体font-weight:bold,防止抖动

    项目一个小问题困扰了很久,在一个没有限制宽度的列表容器中,如果给hover时,给字体➕'font-wieght:bold'容器就会变宽,然后移动的下一个容器,就会出现抖动,这样很是影响用户体验,于是在 ...

  10. django自带的登录验证功能

    django自带的验证机制 from django.shortcuts import render, redirect from django.contrib.auth import authenti ...