'
*********************************************************** ************************** "file: set color of enttive shortcut.vbs 'version: 1.0' copyright: floodzhu (floodzhu @ Hotmail. COM), 2005.1.6 'Features: Traverse concept model, set the color of the Entities shortcut to yellow. '********************************************************** ************************************* 'DIM FS, F' SET FS = CreateObject ("scripting.filesystemObject") 'set f = fs .Createtextfile ("c: /PowerDesigner_vbs.log")
DIM INDEX
INDEX = 0
DIM MODEL
Set model = ActiveModel
IF (Model Is Nothing) THEN
"MsgBox" There is currently no active model. "
Elseif Not Model.isk Indof (PDCDM.CLS_MODEL) THEN
Msgbox "The current model is not a conceptual model."
Else
View model
Msgbox INDEX & "The color of the real way is set."
END IF
'********************************************************** **************************** The function: view 'function: recursive traversal "*********** *********************************************************** ****************
Sub View (Folder)
Dim Node
For Each Node in Folder.ntities
IF node.isshortcut then
Visit Node
END IF
NEXT
'Recurrence of subdirectory
DIM Subfolder
For Each Subfolder in Folder.Packages
View Subfolder
NEXT
End Sub
'********************************************************** *************************** The function: Visit 'function: processing node' *********** *********************************************************** ************** SUB VISIT (NODE)
DIM SYM
For Each Sym in Node.Symbols
Sym.fillcolor = RGB (255, 255, 128)
INDEX = INDEX 1
'F.WriteLine Sym.name & "●" & sym.fillcolor
NEXT
End Sub