You are currently reviewing an older revision of this page.
If the colors have to be changed or adjusted by levels, this can be done with a Keyin, while maintaining the levels to be processed seperately. For example, a lump sum at all levels with a color setting x can be changed to the value y.
As an example, I have created this VBA routine, with two color values (old and new) that must be passed as a parameter to the VBA routine.
If the VBA routine is loaded with the following Keyin, it can be carried out at all levels with color 0 to the color 3 change:
VBA run levelColorFromto 0 3
Option
Base 0
Sub
LevelColorFromto()
Dim
oLv
As
Level
l()
String
l = Split(KeyinArguments,
" "
)
If
UBound(l) <> 1
Then
MsgBox
"Call with 2 parameters: old color value + new color value"
Exit
End
For
Each
In
ActiveDesignFile.Levels
Not
oLv.IsFromLevelLibrary
oLv.ElementColor = Val(l(0))
oLv.ElementColor = Val(l(1))
Next
ActiveDesignFile.Levels.Rewrite