powerdesigner的执行脚本----写入名字到注释中.vbs

powerdesigner是个好东西,我对它很有感情,不过也有些不满,不满有三:

1。采用ms技术,不能在linux等非windows平台上使用,脚本执行语言采用vbscript,建议采用javascript,python,perl等更大众的语言。

2。仅仅支持到uml1.4

3。连接数据的方式只有odbc,很麻烦又落后,连pb都可以支持jdbc连接数据库了,pd是否也该提高一下?

不过

pd中设计工作中经常有些工作需要批量执行修改,采用其自带的脚本语言是个不错的选则,下面这段脚本把pdm中的table的field的name写入到comment中,很方便。


Dim mdl ' the current model

'ceaate by runnerrunning

' get the current active model
Set mdl = ActiveModel '得到当强活动的pdm文档,注意并不是具体的package
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
   MsgBox mdl.name
   packagepdm mdl
End If

' This routine copy name into code 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 &vbCrLf& tab.Comment
         Dim col ' running column
         for each col in tab.columns
            col.Comment = col.name &vbCrLf& col.Comment
         next
      end if
   next

end sub

private sub packagepdm(pdm)
   dim pdm1
   for each pdm1 in folder.Packages
      msgbox pdm1.name
   next

end sub

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值