文章
2021/8/9
PowerDesigneri常用VBS脚本
首先按 Ctrl + Shift + X 打开脚本窗口,把需要的脚本贴进去点Run
将名称转为注释
Option ExplicitValidationMode = TrueInteractiveMode = im_BatchDim mdl ' the current model' get the current active modelSet mdl = ActiveModelIf (mdl Is Nothing) ThenMsgBox "There is no current Model "ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) ThenMsgBox "The current model is not an Physical Data model. "ElseProcessFolder mdlEnd If' This routine copy name into comment for each table, each column and each view' of the current folderPrivate sub ProcessFolder(folder)Dim Tab 'running tablefor each Tab in folder.tablesif not tab.isShortcut then' 表名赋给表注释tab.comment = tab.nameDim col ' running columnfor each col in tab.columns' 列名赋给列注释 引入的不能操作做错误处理on error resume nextcol.comment= col.namenextend ifnextDim view 'running viewfor each view in folder.Viewsif not view.isShortcut thenview.comment = view.nameend ifnext' go into the sub-packagesDim f ' running folderFor Each f In folder.Packagesif not f.IsShortcut thenProcessFolder fend ifNextend sub如果咩咩的文章对您有帮助,您可以 请我喝牛奶