'*****************************************************************************
'文件:set color of entities shortcut.vbs
'版本:1.0
'版權(quán):floodzhu( [email protected] ),2005.1.6
'功能:遍歷概念模型,把entities的快捷方式的顏色設(shè)置為黃色。
'*****************************************************************************
' 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 "當(dāng)前沒有活動(dòng)的模型。"
elseif not model.iskindof(pdcdm.cls_model) then
msgbox "當(dāng)前模型不是概念模型。"
else
view model
msgbox index & "個(gè)實(shí)體的快捷方式的顏色被設(shè)置。"
end if
'*****************************************************************************
'函數(shù):view
'功能:遞歸遍歷
'*****************************************************************************
sub view(folder)
dim node
for each node in folder.entities
if node.isshortcut then
visit node
end if
next
'對(duì)子目錄進(jìn)行遞歸
dim subfolder
for each subfolder in folder.packages
view subfolder
next
end sub
'*****************************************************************************
'函數(shù):visit
'功能:處理節(jié)點(diǎn)
'*****************************************************************************
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
新聞熱點(diǎn)
疑難解答
圖片精選