Author Topic: Freeze Off Layers Routine  (Read 2816 times)

0 Members and 1 Guest are viewing this topic.

ronjonp

  • Needs a day job
  • Posts: 7531
Freeze Off Layers Routine
« on: March 18, 2004, 06:20:31 PM »
I Know I've seen this somewhere.....

Lisp that finds all layers that are turned off and freezes them. Anyone here got it?

Thanks,

Ron :D

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Freeze Off Layers Routine
« Reply #1 on: March 18, 2004, 07:51:24 PM »
Well... it leaves them off but it freezes them as well.... Not sure about use with viewports...
Code: [Select]

(defun C:layfrzoff( / lay layname laylist)
  (setq lay (tblnext "layer" t))
  (while lay
    (setq layname (cdr (assoc 2 lay)))
    (if (<(cdr (assoc 62 (tblsearch "layer" layname))) 0)
      (progn
        (setq laylist (entget (tblobjname "layer" (cdr (assoc 2 lay)))))
(entmod (subst (cons 70 1) (assoc 70 laylist) laylist))
      )
    )
    (setq lay (tblnext "layer"))
  )
)
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

ronjonp

  • Needs a day job
  • Posts: 7531
Freeze Off Layers Routine
« Reply #2 on: March 19, 2004, 10:28:33 AM »
Thanks Keith...that worked excellent!

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Freeze Off Layers Routine
« Reply #3 on: March 19, 2004, 11:10:46 AM »
You are quite welcome...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie