My requirement is to set snap spacings according to the layer been selected in LSW. To achieve this, i have following questions:
1) How to check which layer is selected currently?
2) If i have the script which is able to identify the layer selected and accordingly change my snap spacings, then how can i schedule that script so that as soon as i change my layer selection in my LSW snap spacings should change automatically. Is there a way to do that?
The first question is leGetEntryLayer. For the second question, I'm not sure there's any public trigger for doing this. One option would be to use leRegUserObjectSelectionFilter (which is public) which gets called as soon as you move over an object prior to selection. You'd need to make it return t, but you could retrieve the entry layer and set the snap spacing there. For example - this just displays the entry layer whenever you move over an object. Note that you must keep such a function fast to avoid affecting interactivity.
procedure(CCFcurrentLayer(figId) printf("ENTRY: %L\n" leGetEntryLayer()) t)leRegUserObjectSelectionFilter("CCFcurrentLayer")
Otherwise, perhaps you could contact customer support to request a trigger on entry layer change? There's already one on layer selection (leRegUserLayerSelectionFilter), but that's only when selectabilty of a layer is changed.
If you are simply setting snap spacings for routing layers and you are using wires in 6.1, you should look into either creating routing tracks, or setting up routing grids in the techfile.
To create routing tracks, use Create->P&R Objects->Track Patterns
To setup routing grids, you can define them in the constraintGroups section of the techfile under the sub-section routingGrids.
Once you setup either of these, then on your Editor Options form in layout, you can choose to snap to manufacturing grid (default), track patterns, or routing grids.
Options->Editor, then look in the bottom left to set Snapping for Wires.