Hi can any one show some light on how to perform the solution. For example if i have "M1 drawing layer" visible in LSW , then if i press some bindkey the M1 dummy layer should get vissible. I have tried some code but it isnt working. Copied for reference below
for(i 1 10
x=leIsLayerVisible( list("layer" "drawing") )
if( x == "t" then (
hiSetBindKey("Layout" "Ctrl<Key>8" "showDummySet() ")
I think you need to use leSetLayerVisible instead of leSetEntryLayer, you might want to give that a try.
In reply to chianga:
I was getting this error for both leSetLayerVisible & leSetEntryLayer as
*WARNING* (TECH-2000192): leIsLayerVisible: Invalid layer/purpose - ("layer" "drawing").
I am not able to set the layer as per my wish. So either i have to use a "when" and make the code huge or any other option to sort this out.
In reply to Neeraj Vardhan:
You have quotes around "layer" which means it will be treated as a literal string, rather than the variable you intended. Take these quotes away and you may get it working. (I have not looked in detail at this code, I just noticied this bit).
In reply to skillUser:
Thanks a lot Lawrence, the code is working fine .
I didn't get the error you did - because there's a missing close parenthesis on the first leIsLayerVisible. If I add that, then I get the error you got, because there's an erroneous open parenthesis on the if line. For good measure I declared all the variables in the code as local too - and it now works fine (it did without adding the let, but I though it was a good idea to add):
procedure(showDummySet() let((z layer x) for(i 1 9 z="M" layer=concat(z,i) print(layer) x=leIsLayerVisible(list(layer "drawing")) print(x) if( x == t then leSetLayerVisible(list(layer "drawing") t) leSetLayerVisible(list(layer "slot") t) ) ) ))
Note that we would recommend that you use a prefix for your function to avoid clashing with anyone else's function called "showDummySet".