OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Kerry on July 30, 2007, 08:05:50 PM

Title: Layer Combo filtering
Post by: Kerry on July 30, 2007, 08:05:50 PM
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
Title: Re: Layer Combo filtering
Post by: dkh007 on July 30, 2007, 08:53:07 PM
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))
  )
)
Title: Re: Layer Combo filtering
Post by: Kerry on July 30, 2007, 09:23:29 PM
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.

Title: Re: Layer Combo filtering
Post by: dkh007 on July 31, 2007, 04:07:40 AM
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.