chrisdarmanin Posted September 14, 2009 Posted September 14, 2009 is it possible for someone to make me a lisp to invert the layer status? (on/off, frozen/thawed) what do you think? is it easy? many thanks in advance Quote
alanjt Posted September 14, 2009 Posted September 14, 2009 is it possible for someone to make me a lisp to invert the layer status? (on/off, frozen/thawed) what do you think? is it easy? many thanks in advance I'll be glad when this insomnia wears off, I'd like to go to bed. This is a fairly easy task to accomplish. Definitely something anyone could accomplish with a little work. Hope this helps. BTW, I think this can be accomplish in the layer manager, but I'm not sure, I never open it. ;;; Invert on/off and freeze/thaw state of all layers in drawing ;;; Alan J. Thompson, 09.14.09 (defun c:LayerInvert (/ #Doc) (vl-load-com) (vlax-for x (vla-get-Layers (setq #Doc (vla-get-activedocument (vlax-get-acad-object)) ) ;_ setq ) ;_ vla-get-Layers ;; invert on/off state (vl-catch-all-apply 'vla-put-layeron (list x (if (eq (vla-get-layeron x) :vlax-true) :vlax-false :vlax-true ) ;_ if ) ;_ list ) ;_ vl-catch-all-apply [color=Red];; invert freeze/thaw state (vl-catch-all-apply 'vla-put-freeze (list x (if (eq (vla-get-freeze x) :vlax-true) :vlax-false :vlax-true ) ;_ if ) ;_ list ) ;_ vl-catch-all-apply[/color] ) ;_ vlax-for (vla-regen #Doc acActiveViewport) (princ) ) ;_ defun Quote
chrisdarmanin Posted September 14, 2009 Author Posted September 14, 2009 hmmm.... it doesnt seem to switch on those that are off...... (because it needs to do that) Quote
alanjt Posted September 14, 2009 Posted September 14, 2009 hmmm.... it doesnt seem to switch on those that are off...... (because it needs to do that) Works fine for me. On->Off, Off->On, Frozen->Thawed, Thawed->Frozen I even tested it on a file that has 730 layers (some even xrefed) with all assorted states. Everything was completely successful. Quote
chrisdarmanin Posted September 14, 2009 Author Posted September 14, 2009 i'll try again on another drawing later.... busy at work at the moment.... btw have you managed to get some sleep? Quote
alanjt Posted September 14, 2009 Posted September 14, 2009 i'll try again on another drawing later.... busy at work at the moment.... btw have you managed to get some sleep? Hope you get it to work. I'll give it another look tomorrow. Still no sleep, but I'm going to make another attempt at it. Quote
chrisdarmanin Posted September 15, 2009 Author Posted September 15, 2009 i realised my problem now which is with my original question :S can you remove the part where it inverts the freeze/thawed state because i was letting everything thawed so it froze everything.... my mistake sorry.... thanks again for your help Quote
alanjt Posted September 15, 2009 Posted September 15, 2009 i realised my problem now which is with my original question :S can you remove the part where it inverts the freeze/thawed state because i was letting everything thawed so it froze everything.... my mistake sorry.... thanks again for your help Easy fix, just remove this portion from the above code (I marked it in red): ;; invert freeze/thaw state (vl-catch-all-apply 'vla-put-freeze (list x (if (eq (vla-get-freeze x) :vlax-true) :vlax-false :vlax-true ) ;_ if ) ;_ list ) ;_ vl-catch-all-apply Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.