Jump to content

Recommended Posts

Posted

Entmod freezing current layer example:

 

(defun c:FreezeCurrent nil
 ((lambda (la) (entmod (subst (cons 70 1) (assoc 70 la) la)))
   (entget (tblobjname "layer" (getvar 'clayer)))
 )
 (princ)
)

Posted

or Toggle, just for fun...

 

(defun c:Tog nil
 ((lambda (la) (entmod (subst (cons 70 (abs (1- (cdr (assoc 70 la))))) (assoc 70 la) la)))
   (entget (tblobjname "layer" (getvar 'clayer)))
 )
 (princ)
)

Posted

Bear in mind those assume no other bits are set... :unsure:

 

Perhaps better to use a boole check:

 

;; Freeze/Thaw Layer  ~  Lee Mac
;; layer - layer table object (tblobjname)
;; freeze - 1 = Freeze Layer
;;          0 = Thaw Layer

(defun FTLayer ( layer freeze / dx70 el )
 (setq dx70 (cdr (assoc 70 (setq el (entget layer)))))
 (entmod
   (subst
     (cons 70 (boole (+ 4 (* freeze 3)) 1 dx70)) (assoc 70 el) el)))

Posted
Bear in mind those assume no other bits are set... :unsure:

 

Perhaps better to use a boole check:

Yeah, I know (ergo the reason I said for fun.:wink:). However, I was under the impression that the 70 code for layers was only 1 or 0. Granted, time could alter something. Good point regardless.

  • 10 years later...
Posted

LeeMac,

 

How do I alter your .lsp to do what I want it to? You mentioned wildcards.....

Posted (edited)

If you were running manually

 

-LA F cable* Enter 

 

This would freeze all layers that start their name with cable

 

SSget supports *, *line will find lines plines etc.

 

I am not sure which code version your running as there are a few posts, and this post was from 2010.

Edited by BIGAL

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...