In that case you'll need to fix the code (or global variables that it uses) to make it work. You know what you want it to do, and you've not enlightened anyone on the forum, so I'm not really sure what you're expecting.
I went to the effort of tidying up the formatting of the code so I stood some chance of understanding it:
procedure(ST_Lyt_ShowHide_Layers(Command PressedKey ShowDummy)
;Available values for Command: >=1 to Add, <=1 to Remove and 0 to Hide all but selected one
;Available values for ShowDummy: t to show dummy types and nil to keep dummy layers hidden
Lyt_Key_Layer_Assoc = '( ("0" 0) ("1" 1) ("2" 2) ("3" 3) ("4" 4) ("5" 5) ("6" 6) ("7" 7) ("8" 8) ("9" 9) ("`" 10) ("-" 11) )
Lyt_Sel_Layers = nth(nth(1 assoc(PressedKey Lyt_Key_Layer_Assoc)) Lyt_Layer_List)
Lyt_Show_Layer = nil
if((Command >= 0) then
leSetEntryLayer(list(nth(0 Lyt_Sel_Layers) nth(0 Lyt_Layer_Purposes)))
if((Command == 0) then
leSetAllLayerVisible(nil)
)
foreach(Lyt_SLayer Lyt_Default_Layers
foreach(Lyt_SPurpose Lyt_Layer_Purposes
LytShowLayer = t
if((Lyt_SPurpose == Lyt_Dummy_Purpose_Name) then
LytShowLayer = ShowDummy
)
leSetLayerVisible(list(Lyt_SLayer Lyt_SPurpose) LytShowLayer)
)
)
Lyt_Show_Layer = t
)
if((Command >= -1) then
leSetEntryLayer(list(nth(0 Lyt_Default_Layers) nth(0 Lyt_Layer_Purposes)))
)
foreach(Lyt_SLayer Lyt_Sel_Layers
foreach(Lyt_SPurpose Lyt_Layer_Purposes
LytShowLayer = Lyt_Show_Layer
if((rexMatchp(strcat(".*" Lyt_Dummy_Purpose_Name ".*") Lyt_SPurpose) == t) then
LytShowLayer = (ShowDummy && LytShowLayer)
)
leSetLayerVisible(list(Lyt_SLayer Lyt_SPurpose) LytShowLayer)
)
)
hiRedraw()
)
And I can see from this that it uses four global variables. I tried setting these (based on some guess work) to match some settings in a gpdk technolog:
Lyt_Layer_List='(("Metal1" "drawing") ( "Metal2" "drawing") ( "Metal3" "drawing") ( "Metal4" "drawing"))
Lyt_Layer_Purposes='("drawing" "slot" "label" "pin" "net")
Lyt_Default_Layers='("Poly" "Oxide")
Lyt_Dummy_Purpose_Name="slot"
But since I don't really understand what the code is trying to do (it seems rather strangely written, but maybe all would become clear if I knew what the global variables were supposed to look like), I couldn't really see what it was aiming at.
Please be aware that readers of the forum (including myself) cannot read your mind - so please, please, explain yourself clearly otherwise nobody is going to be able to help you. I've already spent quite a bit of my time (note, it's my own time as I do this as a volunteer not as part of my job with Cadence) trying to fathom out what you're actually asking...
Saying things like "it doesn't do what I want" doesn't really tell anyone what the problem is. In fact it doesn't even say that you want anything answered, so maybe you're happy already?
Kind Regards,
Andrew.