purge frozen & empty layers
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
purge frozen & empty layers

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
yavid
Guest





Posted: Fri Dec 24, 2004 2:50 am    Post subject: purge frozen & empty layers Reply with quote

Does anyone have a LISP that will purge a drawing of layers that are frozen but do not contain entities? I often have to thaw a dozen layers only to find that they don't contain anything, it would be nice to be able to automatically turf them without thawing them. I am fairly new to LISP and I think this one is beyond me. Thanks in advance for any and all help.

Back to top
Russell Dieges
Guest





Posted: Fri Dec 24, 2004 2:57 am    Post subject: Re: purge frozen & empty layers Reply with quote

Why not:

PURGE

on the command line?


Russell Dieges
Back to top
Jason Piercey
Guest





Posted: Fri Dec 24, 2004 2:58 am    Post subject: Re: purge frozen & empty layers Reply with quote

If the layers are simply frozen, not frozen in a
viewport the stock PURGE command will do
what you want.

--
Autodesk Discussion Group Facilitator



"yavid" <nospam@address.withheld> wrote in message
news:28714417.1103838661362.JavaMail.jive@jiveforum1.autodesk.com...
Quote:
Does anyone have a LISP that will purge a drawing of layers that are
frozen but do not contain entities? I often have to thaw a dozen layers

only to find that they don't contain anything, it would be nice to be able
to automatically turf them without thawing them. I am fairly new to LISP
and I think this one is beyond me. Thanks in advance for any and all help.

Back to top
yavid
Guest





Posted: Fri Dec 24, 2004 3:02 am    Post subject: Re: purge frozen & empty layers Reply with quote

I apologize, I neglected to mention that they are frozen in the viewports.
Back to top
Don Reichle
Guest





Posted: Fri Dec 24, 2004 4:20 am    Post subject: Re: purge frozen & empty layers Reply with quote

Hopefully you don't have more than two or three Viewports. If quite a few, I
would consider using a script in a User button, if I had this task to do.

Hopefully this would be the only instance where this is necessary.

Otherwise, I would recommend some training for whoever is doing this.

Without Lisp...

Starting from Paper Space;

Double-click in 1st Viewport;

LMAN;

Save a JUNK state with them all frozen in the viewport;

Close LMAN;

LAYER;

Thaw all in the Current Viewport;

Close Layer Manager;

Purge.

Repeat until you have done all the Viewports.

Now you might see why I recommend a Button Script.

HTH

--
Don Reichle
"King Of Work-Arounds"
Barghausen Consulting Engineers
Kent, WA USA
LDT3 - SP1/CD3 - SP1
On WIN2K SP4
Dell 1.6 Ghz P4
512MB RAM
NVIDIA 32MB AGP


"yavid" <nospam@address.withheld> wrote in message
news:14039123.1103839400660.JavaMail.jive@jiveforum1.autodesk.com...
> I apologize, I neglected to mention that they are frozen in the viewports.
Back to top
Jason Piercey
Guest





Posted: Tue Dec 28, 2004 1:09 am    Post subject: Re: purge frozen & empty layers Reply with quote

It appears that vla-delete will remove layers that
are unreferenced but frozen in a viewport. Kinda
handy.

--
Autodesk Discussion Group Facilitator



"yavid" <nospam@address.withheld> wrote in message
news:14039123.1103839400660.JavaMail.jive@jiveforum1.autodesk.com...
> I apologize, I neglected to mention that they are frozen in the viewports.
Back to top
tstright
Guest





Posted: Tue Dec 28, 2004 4:18 pm    Post subject: Re: purge frozen & empty layers Reply with quote

Picked this up somewhere....
Use with Care.

;PLA-deletes all entities on frozen or off layers and purges everything
(defun C:PLA (/ cmde tmod llst la lnam lfrz loff)
(setq cmde (getvar "cmdecho")
tmod (getvar "tilemode")
llst ""
la (tblnext "layer" T))
(setvar "cmdecho" 0)
(while la
(setq lnam (cdr (assoc 2 la))
lfrz (= (logand (cdr (assoc 70 la)) 1) 1)
loff (minusp (cdr (assoc 62 la))))
(if (or lfrz loff)
(progn
(if (setq ss (ssget "x" (list (cons 8 lnam))))
(command "_.-layer" "_u" lnam ""
"_.erase" ss ""))
(setq llst (strcat lnam "," llst)
la (entget (tblobjname "layer" lnam))
la (subst '(70 . 0)(assoc 70 la) la))
(entmod la)))
(setq la (tblnext "layer")))
(if (> llst "")
(command "_.tilemode" 0
"_.vplayer" "_t" llst "_a" ""))
(repeat 3
(command "_.purge" "_a" "*" "_n"))
(setvar "cmdecho" cmde)
(setvar "tilemode" tmod)
(princ)
)
Back to top
yavid
Guest





Posted: Thu Dec 30, 2004 2:11 am    Post subject: Re: purge frozen & empty layers Reply with quote

Is there a way to tweak this LISP so it will not delete entities on frozen layers? I need a LISP that will purge out the layers that do not contain entities but are frozen in VP. The layers frozen in VP that do contain entities must be left unchanged (not purged, not thawed).
Back to top
T.Willey
Guest





Posted: Thu Dec 30, 2004 2:31 am    Post subject: Re: purge frozen & empty layers Reply with quote

Try this. It will thaw all layers that have nothing on them in all viewports so you can purge them out.

Tim

(defun ThawVPLayers (/ ss Ent temp1 LayList)

(setq ss (ssget "x" '((0 . "VIEWPORT"))))
(while (setq Ent (ssname ss 0))
(setq temp1 (entget Ent))
(foreach item temp1
(if (= (car item) 331)
(setq LayList (cons (cdr (assoc 2 (entget (cdr item)))) LayList))
)
)
(ssdel Ent ss)
)
(foreach item LayList
(if (not (setq ss (ssget "x" (list (cons 8 item)))))
(command "_.vplayer" "_t" item "_a" "")
)
)
)
Back to top
Jason Piercey
Guest





Posted: Thu Dec 30, 2004 2:48 am    Post subject: Re: purge frozen & empty layers Reply with quote

Try this:

(defun c:removeUnreferencedLayers ()
(vlax-for
item
(vla-get-layers
(vla-get-activedocument
(vlax-get-acad-object)))
(vl-catch-all-apply 'vla-delete (list item))
)
(princ "\nunreferenced layers have been removed")
(princ)
)

--
Autodesk Discussion Group Facilitator



"yavid" <nospam@address.withheld> wrote in message
news:20604566.1104354743526.JavaMail.jive@jiveforum2.autodesk.com...
Quote:
Is there a way to tweak this LISP so it will not delete entities on frozen
layers? I need a LISP that will purge out the layers that do not contain

entities but are frozen in VP. The layers frozen in VP that do contain
entities must be left unchanged (not purged, not thawed).
Back to top
James Allen
Guest





Posted: Fri Dec 31, 2004 11:45 pm    Post subject: Re: purge frozen & empty layers Reply with quote

I believe I discovered recently that it will even get those frozen in a
viewport (a2k5), but I'm not at work today so I can't verify.
--
James Allen, EIT
Malicoat-Winslow Engineers, P.C.
Columbia, MO


"Jason Piercey" <Jason AT atreng DOT com> wrote in message
news:41cb3f05$1_3@newsprd01...
Quote:
If the layers are simply frozen, not frozen in a
viewport the stock PURGE command will do
what you want.

--
Autodesk Discussion Group Facilitator
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Contact Us
Powered by phpBB