PowerDesigner的pdm列 相关操作记录,后期有用到继续补充

文章讲述了在PDM设计中取消名称与编码联动的必要性,以防止设计错误。提供了使用PowerDesigner工具进行Name与Comment同步的脚本,包括Name同步至Comment和Comment同步至Name的过程。

 1、取消联动原因:做PDM设计的时候属性列的名称和编码联动实际上没有必要,这样会导致设计人员将列表写到备注字段,照成导出的设计文件会有问题,一般会将这个联动去掉。

依次单击工具栏中的【Tools】---->【General Options】;

在弹出框左侧导航栏选择【Dialog】,然后去掉右边的【Name to Code mirroring】选项前的勾选项

2、使用Powerdesigner工具将pdm文件的name同步至comment。

点击Tools->Execute Commands->Edit/Run Scripts

Option   Explicit 
 
ValidationMode   =   True 
 
InteractiveMode   =   im_Batch 
 
Dim   mdl    
 
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) 
 
        Dim   Tab 
 
        for   each   Tab   in   folder.tables 
 
              if   not   tab.isShortcut   then
 
                    tab.comment=tab.name
 
                    Dim   col
 
                    for   each   col   in   tab.columns
 
                                                if col.comment="" then
 
                                                    col.comment=col.name 
 
                                                end if
 
                    next 
 
              end   if           
 
        next
 
end   sub

3、使用Powerdesigner工具将pdm文件的comment同步至name。

点击Tools->Execute Commands->Edit/Run Scripts

Option   Explicit 
 
ValidationMode   =   True 
 
InteractiveMode   =   im_Batch 
 
Dim   mdl    
 
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) 
 
        Dim   Tab 
 
        for   each   Tab   in   folder.tables 
 
              if   not   tab.isShortcut   then
 
                    tab.name=tab.comment
 
                    Dim   col
 
                    for   each   col   in   tab.columns
 
                        col.name=col.comment 
 
                    next 
 
              end   if           
 
        next
 
end   sub

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值