Layer Combo filtering

Started by Kerry, July 30, 2007, 08:05:50 PM

Previous topic - Next topic

Kerry

reposted from SourceForge:

I may be suffering from brain drain ...

Using the Layer Combo I have this or similar code in a couple of routines ...

(DEFUN c:SSP99-01_F_OnInitialize (/ layerList)
    (SETQ g:BlockLayer     "ST-BLOCKS"
          g:DimScaleFactor (GETVAR "DIMSCALE")
    )
    (CTAU:ASSERTLAYER g:BlockLayer)
    (SETQ
        layerList (VL-REMOVE-IF
                      '(LAMBDA (var) (WCMATCH var "*$*"))
                      (CTAU:LISTCOLLECTIONMEMBERNAMES (CTAU:IACADLAYERS))
                  )
    )
    (DCL_COMBOBOX_ADDLIST SSP99-01_F_BlockLayerCombo layerList)
    (DCL_COMBOBOX_SELECTSTRING SSP99-01_F_BlockLayerCombo g:BlockLayer)
    (IF (NOT gvar:SSP99DataList)
        (PROMPT "\n Data List To Be initialised.")
    )
)


Essentially, I had imagined that the code provided a filtered layer list to the LayerCombo.
.. in this case filtering out XRef Layers

Either it's stopped working or I delusionally believed it did work.

Any ideas ?
/// kwb
Perfection is not optional.
My other home is TheSwamp

dkh007

Vertical bars seperate XREFS "|" Dollar signs "$" are for XREFS converted to INSERTS.

Here is one way to get a layer list excluding the XREFS, for a long list I added the sorting.


(defun laylist (/ llist lnlist)
  (while (setq llist (tblnext "layer" (not llist)))
    (setq lnlist (cons (cdr (assoc 2 llist)) lnlist))
  )
)

(SETQ layerList
  (VL-REMOVE-IF
    '(LAMBDA (var) (WCMATCH var "*|*"))
    (acad_strlsort (laylist))
  )
)
Daniel Hargreaves, AIA, CSI, CDT, RAS
accustudio.com

Kerry

Thanks Daniel, I had the filtering method resolved ..

Owen responded at SourceForge that the LayerCombo appears to not honour the AddList Method .. so I'll use a conventional Combo.

Perfection is not optional.
My other home is TheSwamp

dkh007

Sometimes it helps to read the whole post  ;) I was only looking at a filtered list problem, and not necessarily a filter list for the layercombo problem. Glad you got something resolved.
Daniel Hargreaves, AIA, CSI, CDT, RAS
accustudio.com