I hope this is going into the custom ic skill forum this time...
I want to be able to remap my LSW to contain only the layers that are in the active window, hence getting rid of all the "clutter" of unused layers.
I have been given a hint that the commands
cvId = geGetWindowCellView()
lpps = cvId~>lpps
will place into lpps all of the layer:purposes that are in the active window. How can I use this to then redraw the LSW? i would imagine that merely setting to valid only the layer:purposes in lpps would do the trick.
complete code is there man...
The program that you are looking for :
procedure( CCSupdateLSWwithUsedLayers(@optional (cv geGetEditCellView())) let((techFile lppList lswLayerList)
when(and(dbIsId(cv) dbGetq(cv objType)) ;; get the tech file database ID techFile = techGetTechFile(cv)
;; foreach layer-purpose pair in the cellviews' layer-purpose ;; pairs in use, store a list of layer-purpose pairs lppList = foreach( mapcar (layer purpose) cv~>lpps~>layerName cv~>lpps~>purpose list(layer purpose) )
;; get the current list of layer-purpose pairs in the LSW lswLayerList = leGetValidLayerList(techFile)
;; for each layer-purpose pair in the LSW, check if this is in ;; use in the cellview, if not, use the leSetLayerAttributes ;; function to remove the layer from the LSW foreach( lswLayer lswLayerList unless(member(lswLayer lppList) leSetLayerAttributes(techFile list(lswLayer nil nil nil)) ) )
;; for each layer-purpose pair in the cellview, check if this is ;; in the LSW already, if not, add the layer to the LSW foreach( lppLayer lppList unless(member(lppLayer lswLayerList) leSetLayerAttributes(techFile list(lppLayer t t t)) ) ) t ); when given a valid db object for a cellview ); let); procedure CCSUpdateLSWwithUsedLayers
The code is avaliable in the following SourceLink solution :
How to update LSW window to only display layers used in a given layout window ?
I include the SourceLink link as the full code is there with the header and disclaimer etc.and this code may be updated (but the community post probably would not be).
Please get the code from SourceLink