pdm文件name与comment互相同步

工具=>执行命令=>编辑/运行脚本

1.name同步到comment
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

2.comment 同步到 name
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

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • pyspark.sql模块 模块上下文 Spark SQL和DataFrames的重要类: pyspark.sql...
    mpro阅读 9,988评论 0 13
  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,974评论 0 10
  • 2019.5.27 119/999感恩已有,真爱自己。 1.感恩自己创造的不可思议的今天。 感恩早起的自己,周复盘...
    Amy宝宝阅读 393评论 0 4
  • 最近一直在思考有关教育的问题,怎样让学生爱上学习,怎样让学生体会到学习的乐趣,怎样让学生养成良好的学习习惯……这些...
    稻子未熟阅读 512评论 1 6
  • 年末已至,翻翻自己一年来自己的行为记录,结果是泛善可陈。至于这一年来的成就事件,很多只是有了一个开始,最后都是不了...
    心念有约阅读 436评论 1 0

友情链接更多精彩内容