I love layersets. I have unique layersets for vias (ie "via1" = m1 (draw, pin, fill), via1, & m2 (draw, pin, fill)), "base" layers, all "fill", all "pins", etc.
I would like to be able to map and toggle them with bindkeys (or get some skill code where I could have the same functionality), as well as set the active layer for each - this would increase my productivity dramatically, imho.
Here is some code that Rupinder sent me a couple years ago (i had some time-off), but I am not certain how to implement it to get it working:
procedure( setActiveLayerAndLayerSetVisibility( metalLayer visible)
let( (layer)
sprintf( layer "m%d drawing" metalLayer)
sprintf( layerSet "v%d" metalLayer )
pteSetLSVisible("All Layers" nil)
pteSetLSActive(?layerSets layerSet ?deactivateOthers t)
pteSetLSVisible(layerSet visible)
;uncomment the following lines if you want this function to set active layer and start wire command
;pteSetActiveLpp( layer )
;leHiCreateWire()
) ;let
) ;procedure
Then you can add bindkeys to call the above function and pass different numbers and visibility status. For example, to activate layerSet v2, pass number 2 and t as arguments to the function call. “t” means the visibility of layers is on. “nil” means visibility is off.
hiSetBindKey "Layout" "<key>2" "setActiveLayerAndLayerSetVisibility( 2 t )"
hiSetBindKey "Layout" "<ctrl>2" "setActiveLayerAndLayerSetVisibility( 2 nil )"
Similarly, you can assign bindkey 3 to set v3 as active layerSet.
My first question is about the "%" - is this a generic string? If so, how would this procedure include fill and pins for both metal layers associated with, for example, via1 (m1 &m2)?
Also, what does the "?" do? Lastly, would the same procedure work for "all pins", "all fill", and "all base layers?"
Thank you in advance to anyone interested in this topic!
London