PowerDesigner script: Set the color of the entity shortcuts
Source: Internet
Author: User
Script | shortcuts ' *****************************************************************************
' File: Set color of entities Shortcut.vbs
' Version: 1.0
' Copyright: Floodzhu (floodzhu@hotmail.com), 2005.1.6
' Function: traverse the conceptual model and set the color of the entities shortcuts 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 are currently no active models. "
ElseIf not model. IsKindOf (Pdcdm.cls_model) Then
MsgBox "The current model is not a conceptual model. "
Else
View model
The color of the shortcuts for the MsgBox Index & "entity" is set. "
End If
'*****************************************************************************
' Function: View
' Function: Recursive traversal
'*****************************************************************************
Sub View (folder)
Dim node
For each node in folder. Entities
If node. Isshortcut Then
Visit node
End If
Next
' Recursively for subdirectories
Dim subfolder
For each subfolder in folder. Packages
View subfolder
Next
End Sub
'*****************************************************************************
' 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
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service