Not quite sure I understand what you mean by ``
check entmod'' but you can check each layers group code 70 with a simple logand or meybe even use (boole 7...). It kinda depends on what you want and what you want to check for.
For the new users to Autolisp (Things you should take from this topic):Dont concern yourself with the speed of
entmod/make vs
VL functions.
If your not comfortable with using
entmod/make or the
VL functions you can still have a safe, robust, and good application using
command.
Command is perfectly fine for most applications and uses, you just need to set yourself up properly (Think before coding). To give you a small example:
If you wanted to use
command, here is some code I would try and use vs the previous posted versions all the previous versions start and finish the layer command for every layer in the list (For a list of 100 layers that means that the layer command starts and stops a 100 times).
Here is what my application would look like (Note, i just typed this up and only tested it once to see if it worked--this was a fast quickie-).
;;
;; This is my custom layer freezing application
;;
;; created by:
;; date created:
;;
;; notes:
;;
;; TODO:
;; ------------------
;; support procedure
;; ------------------
(defun addcommas (items)
(if (null items)
nil
(cons
(if (null (cdr items))
(list (car items))
(list (car items) ",") )
(addcommas (cdr items)))) )
;; a quick small procedure to parse and add a comma to each item in a list
;; ...
(setq layer-lst
'("G8010001" "G8010004" "G8010010" "G8010015" "G8010021" "G8010026" "G8010027"
"G8010030" "G8010032" "G8010035" "G8010036" "G8010052" "G8010057" "G8010059"
"G8010071" "G8010072" "G8010098" "G8010321" "G8010374" "G8010376" "G8010382"
"G8010388" "G8010397" "G8010400" "G8010570" "G8010572" "G8011000" "G8011005"
"G8011006" "G8011009" "G8011010")
;; Set up layer name list.
layer-lst (apply 'strcat (apply 'append (addcommas layer-lst))) )
;; Make a comma seperated list from the layer names.
(command "-layer" "fr" layer-lst "")
;; freeze the layers
;; ...
This is also the answer to the initial question (Here is your `push' Scott).
> How to freeze a list of layers?
> « on: Today at 06:02:50 am »
>
> I have the following list of layers (filtered_layerlist)
>
> ("G8010001" "G8010004" "G8010010" "G8010015" "G8010021" "G8010026" "G8010027"
> "G8010030" "G8010032" "G8010035" "G8010036" "G8010052" "G8010057" "G8010059"
> "G8010071" "G8010072" "G8010098" "G8010321" "G8010374" "G8010376" "G8010382"
> "G8010388" "G8010397" "G8010400" "G8010570" "G8010572" "G8011000" "G8011005"
> "G8011006" "G8011009" "G8011010")
>
> I was trying to use the following to freeze all the layers in the above list
>
> (mapcar '(lambda (x) (command "layer" "freeze" x "") filtered_layerlist))
>
> But I know the syntax is not correct for a start - can anyone give
> me a push in the right direction.
>
> Cheers
>
> Scott