Dave,Originally posted in cdnusers.org by dmay
There are two commands recently added to Cadence (within the last 3 years) that help do this.
These two commands register functions that you create to be used as selection filters. The layer selection filter is the simpler of the two. It registers a routine that accepts an lpId (layer purpose object id). If you want the layer to be selectable, the routine returns t, otherwise it returns nil. This will make layers unselectable in the LSW and users will not be able to make them selectable. You will need to re-run leRegUserLayerSelectionFilter if your layer selectability criteria changes. We use this to lock down layers after they tapeout since we don't tapeout all layers at once. We have a separate interface to change what is "permanently locked".
The second routine is what you are looking for. It registers a routine that you create that will accept an object id. The code will determine if the object is selectable or not and return t or nil. This routine must be written efficiently since it effectively runs everytime your cursor moves over a new object. If you have the dynamic hilight option turned on, then you see a dotted line appear over selectable objects when you move your mouse. Your routine will be called prior to displaying this dynamic hilight. If your routine indicates the object is not selectable, then it will not hilight. Keep your code efficient.
We wrote an interface that allows users to mark cells as "unselectable". This information is saved in the cellview. Our routine simply checks to see if the cell is read-only. If it is, then the filter is not applied. If the cell is editable, then if the object id is an instance or a mosaic or a mosaicInst, then it's cellname is compared to the list of unselectable cellnames. If the name is in the list, nil is returned, otherwise it returns t.
I hop this helps.