TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: daron on September 24, 2003, 06:00:19 PM

Title: frozen layer collector
Post by: daron on September 24, 2003, 06:00:19 PM
Se7en, I was going to e-mail you this, but thought it would be great to have for the general public.
Code: [Select]
;;;=============================================================;
;;; FrozenLayerCollector ;
;;;-------------------------------------------------------------;
;;; Purpose: To keep a variable of frozen layer objects ;
;;; Arguments: None ;
;;; Returns: A vla-object list of all frozen layers passed in a ;
;;;     variable called lay-list. ;
;;; ex:(#<VLA-OBJECT IAcadLayer 05470584> ;
;;;     #<VLA-OBJECT IAcadLayer 05470484> ;
;;; #<VLA-OBJECT IAcadLayer 05470444> ;
;;; #<VLA-OBJECT IAcadLayer 054703a4> ;
;;; #<VLA-OBJECT IAcadLayer 054700d4>) ;
;;;-------------------------------------------------------------;
;;; Author: Daron Rogers ;
;;; Date: 09/23/03 ;
;;;=============================================================;
(defun frozenlayercollector (/ lay-list)
     (setq lay-list nil)
     (vlax-for each (vla-get-layers (get-active-document))
 (cond ((= (vla-get-freeze each) :vlax-true)
(setq lay-list (append lay-list (list each)))
      )
 )
     )
     lay-list
)

I originally wrote this for Kate on cadalog.com. Later that same day, I needed a function that could remember what layers were frozen and be able to thaw them and then re-freeze them after scaling objects. It’s not the same as the one I wrote for her, but it is the basis for the idea.
Title: frozen layer collector
Post by: JohnK on September 24, 2003, 06:42:05 PM
Thats saweeet man.  Thanks for sharing.
Title: frozen layer collector
Post by: daron on September 24, 2003, 06:51:24 PM
Sounds like something you were telling that other guy on vbdesign, who wants to have a layer previous routine.