powerdesigner的PDM模型name和comment相互复制替换
在【Tools】-【Execute Commands】-【Edit/Run Script】 下。输入以下命令,这些命令也可以保存起来,扩展名为 vbs ,以便下次使用。
1、name的值复制到comment
'把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中
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的PDM模型name和comment相互复制替换的更多相关文章
- 利用PowerDesigner逆向工程导出PDM模型及生成文档
原文:利用PowerDesigner逆向工程导出PDM模型及生成文档 最近需要对老项目进行重构优化,由于项目都是好几年前的,相关设计资料很不全,最基本的数据库设计文档都没有,只能利用PowerDesi ...
- PowerDesigner 业务处理模型( BPM )
PowerDesigner 业务处理模型( BPM ) 说明 properties语言文档xmlvalidation数据库 目录(?)[+] 一. BPM 简介 业务处理模型(Busi ...
- PowerDesigner之PDM(物理概念模型)
一.PDM概述 PDM(物理数据模型),通俗地理解,就是在PowerDesigner中以图形化的方式展示和设计数据库. PDM中涉及到的基本概念包括: 表: 列: 视图: 主键: 候选键: 外键: 存 ...
- 转 在PowerDesigner的PDM图形窗口中显示数据列的中文注释
Name是名称(字段描述),Code是字段名称,Comment是注释名称,ER图中显示的是Name.一般设计时,Name跟comment都设计成描述, 而设计时候常把comment写成中文,name保 ...
- PowerDesigner之PDM(物理概念模型)各种属性建立如PK,AK等
一.PDM概述 PDM(物理数据模型),通俗地理解,就是在PowerDesigner中以图形化的方式展示和设计数据库. PDM中涉及到的基本概念包括: 表: 列: 视图: 主键: 候选键: 外键: 存 ...
- powerdesigner 画PDM
一.PDM概述 PDM(物理数据模型-Physical Data Modal),通俗地理解,就是在PowerDesigner中以图形化的方式展示和设计数据库. PDM中涉及到的基本概念包括: 表: 列 ...
- PowerDesigner将PDM导出生成WORD文档
PowerDesigner将PDM导出生成WORD文档 环境 PowerDesigner15 1.点击Report Temlates 制作模板 2.如果没有模板,单击New图标创建.有直接双击进入. ...
- 将sql数据库逆向生成PDM模型
由于接手的一个项目是公司前期外包出去的,所以到手的只有繁杂的代码,和数据库文件.由于是个新手,我需要一个数据字典来帮助我完成一些东西,所以我就想到从sql数据库转换出一个pdm模型的数据字典. 第一步 ...
- PowerDesigner之PDM检查
一.PDM检查 1.检查项的设置 PDM错误级别分为Error和Warning两种.Error是致命错,一旦发现这类错误,系统会自动CDM生成PDM或者OOM,Warning是警告错误,是系统认为不合 ...
随机推荐
- 20172328 2018-2019《Java软件结构与数据结构》第一周学习总结
20172328 2018-2019<Java软件结构与数据结构>第一周学习总结 概述 Generalization 本周学习了软件质量.数据结构以及算法分析的具体内容,主要依托于所用教材 ...
- 20172328 2018-2019《Java软件结构与数据结构》第九周学习总结
20172328 2018-2019<Java软件结构与数据结构>第九周学习总结 概述 Generalization 本周学习了无向图.有向图.带权图.常用的图算法.图的实现策略. 教材学 ...
- Pytorch学习(一)基础语法篇
how to use pytorch 1.Tensor we can create a tensor just like creating a matrix the default type of a ...
- [PA2014]Parking
[PA2014]Parking 题目大意: 停车场是一个宽度为\(w(w\le10^9)\)的矩形.我们以其左下角顶点为原点,坐标轴平行于矩形的边,建立直角坐标系.停车场很长,我们可以认为它一直向右边 ...
- dnsmasq配置
介绍 dnsmasq是一个dns和dhcp服务 参数说明 dhcp-sequential-ip 默认情况下Dnsmasq分配ip是根据目标机的mac地址按一定的hash规则来的.这样每个目标机在租约期 ...
- CF_2018-2019 Russia Open High School Programming Contest (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
只做了两个就去上课去啦... A. Company Merging time limit per test 1 second memory limit per test 512 megabytes i ...
- PHP 可以获取客户端哪些访问信息---来自网页转载
php是一种弱类型的程序语言,但是最web的 在程序语言中有系统全局函数: $_SERVER <?php echo "".$_SERVER['PHP_SELF'];#当前正在 ...
- jquery easyui datagrid 如何第一次点击列标题时是降序排列
使用 EasyUI的onBeforeLoad事件,在发回到服务器查询之前,修改排序和对应的图标样式. 1.配置回调函数 data-options='onBeforeLoad:fnOnBeforeLoa ...
- iview menu组件手动收起与展开
本文主要介绍menu组件在有子菜单时如何手动的展开与收起. 展开: 在需要展开的地方先设置openname变量如this.openname = ["设置"]; 再在$nextTic ...
- 菜鸟详细解析Cookie注入原理
一.SQL注入原理 我以aspx为例,现在我们来研究下Cookie注入是怎么产生的,在获取URL参数的时候,如果在代码中写成Request[“id”],这样的写法问题就出现了.我先普及下科普知识,在a ...