PowerDesign Comment显示

代码一:将Name中的字符COPY至Comment中

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
                  tab.comment   =   tab.name
                  Dim   col   ‘   running   column
                  for   each   col   in   tab.columns
                        col.comment=   col.name
                  next
            end   if
      next

Dim   view   ‘running   view
      for   each   view   in   folder.Views
            if   not   view.isShortcut   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

--------------------------------------------

另外在使用REVERSE ENGINEER从数据库反向生成PDM的时候,PDM中的表的NAME和CODE事实上都是CODE,为了把NAME替换为数据库中Table或Column的中文Comment,可以使用以下脚本:

    • 代码二:将Comment中的字符COPY至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

    • -----------------------------------------------------------------------

      以上两段代码都是VB脚本,在PowerDesigner中使用方法为:

      PowerDesigner->Tools->Execute Commands->Edit/Run Scripts

      将代码Copy进去执行就可以了,是对整个CDM或PDM进行操作

    • 原文地址:http://www.cnblogs.com/wuyifu/archive/2013/01/11/2855705.html
时间: 2024-08-28 02:43:15

PowerDesign Comment显示的相关文章

ECshop 表结构

-- 表的结构 `ecs_account_log`CREATE TABLE IF NOT EXISTS `ecs_account_log` (`log_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID号',`user_id` mediumint(8) unsigned NOT NULL COMMENT '用户登录后保存在session中的id号,跟users表中的user_id对应',`user_money` deci

Github.com的Git和TortoiseGit图文教程

图文介绍Windows系统下使用 Github账户 + msysgit + TortoiseGit 进行文件管理的方法. 安装 安装mysysgit 下载地址:msysgit 安装过程: 0.启动 1.默认 2.默认 3.默认 4.默认 5.这步骤很重要,选中 Checkout as-is .这样使用 git clone 时,Git不会擅自改动所获文件的换行符. 6.默认 7.安装完成. 安装TortoiseGit 下载地址:TortoiseGit . 安装过程 0.启动 1.默认-Next 2

ECshop 数据库表结构

ECshop 数据库表结构 -- 表的结构 `ecs_account_log`CREATE TABLE IF NOT EXISTS `ecs_account_log` (`log_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID号',`user_id` mediumint(8) unsigned NOT NULL COMMENT '用户登录后保存在session中的id号,跟users表中的user_id对应',`us

抓取国家统计局2013年全国行政组织机构并插入mysql

数据库创建脚本: /* Navicat MySQL Data Transfer Source Server         : localhost Source Server Version : 50621 Source Host           : localhost:3306 Source Database       : cmm-db Target Server Type    : MYSQL Target Server Version : 50621 File Encoding   

Ajax-ajax实例3-动态树形列表

项目结构: 项目演示: 技术要点: 1.3.2 技术要点在基本原理的介绍中,了解到通过在父节点内动态创建子节点,并利用样式表缩进完成树形列表的基本框架.除了这一点外,还有下面一些问题需要考虑.1 .将父节点所有的子节点放入一个容器中基本原理页面中仅包含了创建子节点的功能,不可以将创建好的节点再进行关闭操作.实际应用中菜单总是包含打开和关闭两种操作.为了方便进行关闭操作,将子节点放入一个容器中,在关闭时只需要设置容器的显示属性即可.2 .节点开关的具体实现每个父节点的所有子节点放入容器中后,在单击

MYSQL数据模型

DROP TABLE IF EXISTS `sh_category`; CREATE TABLE `sh_category` ( `id` int(11) NOT NULL AUTO_INCREMENT, `fid` int(11) NOT NULL COMMENT '父类', `logo` varchar(255) DEFAULT NULL COMMENT '图标', `name` varchar(20) NOT NULL, `sort` int(11) NOT NULL DEFAULT '0

ECSSHOP表结构

-- 表的结构 `ecs_account_log`CREATE TABLE IF NOT EXISTS `ecs_account_log` (`log_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID号',`user_id` mediumint(8) unsigned NOT NULL COMMENT '用户登录后保存在session中的id号,跟users表中的user_id对应',`user_money` deci

Ajax-ajax实例4-多级联动菜单

项目结构: 项目运行: 技术要点: 1.4.1 技术要点在分析具体的实现代码之前,先介绍一下本例的几个技术要点.1 .选项的动态创建与删除document 对象的 createElement 方法可以用来创建一个 HTML 元素.创建好的元素可以通过setAttribute 方法设置其属性.基于以上两点,创建一个选项可以封装的方法如下:function createOption(value, text) {var opt = document.createElement("option"

XML属性列表

<?xml version="1.0" encoding="UTF-8"?> <Resources> <Include > <Attribute name="source" default="" type="STRING" comment="XML布局文件"/> <Attribute name="count" de