PowerDesigner使用技巧

设置单个模型显示,模型上右键单击Format,

设置一个模型后右键单击Get Format  ApplyFormat可以应用到其它选中模型

 

在PowerDesigner中 Tools》Generial Options》Fonts 设置字体为VS默认 Consolas,等宽字体,看起来舒服多了

设置PDM表中显示Code 和 Name

 

设置后效果:

 

 

数据库支持架构导出配置: 

自动生成数据库的说明文档

借助小工具pdmreader(可从http://www.pdmreader.com/下载)打开PDM文件,然后生成说明文档。 

文件 》打开*.pdm数据库字典文件》导出doc

PDM将Comment写入Name脚本:

 1 Option   Explicit 
 2 ValidationMode   =   True 
 3 InteractiveMode   =   im_Batch
 4 
 5 Dim   mdl   '   the   current   model
 6 
 7 '   get   the   current   active   model 
 8 Set   mdl   =   ActiveModel 
 9 If   (mdl   Is   Nothing)   Then 
10       MsgBox   "There   is   no   current   Model " 
11 ElseIf   Not   mdl.IsKindOf(PdPDM.cls_Model)   Then 
12       MsgBox   "The   current   model   is   not   an   Physical   Data   model. " 
13 Else 
14       ProcessFolder   mdl 
15 End   If
16 
17 Private   sub   ProcessFolder(folder) 
18 On Error Resume Next
19       Dim   Tab   'running     table 
20       for   each   Tab   in   folder.tables 
21             if   not   tab.isShortcut   then 
22                   tab.name   =tab.comment+"("+view.code +")"
23                   Dim   col   '   running   column 
24                   for   each   col   in   tab.columns 
25                   if col.comment="" then
26                   else
27                         col.name= col.comment 
28                   end if
29                   next 
30             end   if 
31       next
32 
33       Dim   view   'running   view 
34       for   each   view   in   folder.Views 
35             if   not   view.isShortcut   then 
36                   view.name   = view.comment+"("+view.code+")"
37             end   if 
38       next
39 
40       '   go   into   the   sub-packages 
41       Dim   f   '   running   folder 
42       For   Each   f   In   folder.Packages 
43             if   not   f.IsShortcut   then 
44                   ProcessFolder   f 
45             end   if 
46       Next 
47 end   sub

执行以上脚本,回用Comment替换Name。

在设计PD时,只需要录入Code、Comment,Code会对应数据库字段名,Comment会生成数据库中字段描述。。

Description用于进行备注说明,便于沟通交流。

取消自动关联name和code

PowerDesigner中,但修改了某个字段的name,其code也跟着修改,这个问题很讨厌,因为一般来说,name是中文的,code是字段名。 
解决方法如下: 
1、选择Tools->GeneralOptions...菜单,出现General Options对话框。 
2、从Category中选择Dialog项。 
3、取消右边“Name to Code mirroring”复选框。

本文为作者原创,转载请注明出处。

原文地址:https://www.cnblogs.com/WangHuaiSheng/p/7679266.html