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是警告错误,是系统认为不合 ...
随机推荐
- Selector-背景选择器
Selector-背景选择器 1.主要属性 <?xml version="1.0" encoding="utf-8"?> <selector ...
- python一个命令开启http服务器
1.例如想共享文件在 E:python文件 打开cmd cd E: cd python文件 #进入要分享的文件夹 2.执行py脚本文件 python -m http.server 3.访问 本机i ...
- C++ 控制台推箱子小游戏
// 游戏菜单.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include<iostream> #in ...
- Hibernate 配置文件的基础配置
Hibernate 配置文件主要用于配置数据库连接和 Hibernate运行时所需的各种属性 每个 Hibernate 配置文件对应一个 Configuration 对象 Hibernate.cfg. ...
- CSS3_伸缩盒模型_弹性布局_等分布局_flex 布局
伸缩盒模型 CSS3 引入的布局模式 Flexbox 布局 主要思想: 让容器有能力让其子项目能够改变其宽度,高度,以最佳方式填充可用空间. 特点: display: flex; 只能控制其子元 ...
- ECMA Script 6_解构赋值_模式匹配
解构赋值 从数组中提取值,按照对应位置,对变量赋值 只要等号右边的值不是对象或数组,就先将其转为对象. 由于 undefined 和 null 无法转为对象,所以对它们进行解构赋值,都会报错 let ...
- [LeetCode] Escape The Ghosts 逃离鬼魂
You are playing a simplified Pacman game. You start at the point (0, 0), and your destination is (ta ...
- Java课程课后作业190315之从文档中读取随机数并得到最大连续子数组
从我上一篇随笔中,我们可以得到最大连续子数组. 按照要求,我们需要从TXT文档中读取随机数,那在此之前,我们需要在程序中写入随机数 import java.io.File; import java.i ...
- js 改变只读属性的值
console.log(navigator.platform); // Win32 Object.defineProperty(navigator, 'platform', { value: 'cc' ...
- Oracle 迁移某用户的数据到Sql Server
准备条件: 1.Oracle11g数据库 2.Sql Server 2008 3.Microsoft SQL Server Migration Assistant for Oracle 步奏如下: 1 ...