PDA

View Full Version : Lisp - Thaw Frozen Layers, Then Regen



xspacex
28th Oct 2009, 09:13 am
Hello everyone,

I am in need of some help with this lisp that I am putting together. The code below will basically thaw a specific frozen layer, however, it will not automatically regen after the thaw - the reason for the regen, is so that all objects, lines... that were frozen on this specific layer, will now appear - while I tried the command regen in the lisp, it did not work, so I am looking for suggestions?

Using the same method below, I am wondering how to thaw a layer frozen in a viewport?


Cheers!



(if (setq ename (tblobjname "layer" layname))
(progn
(setq layent (entget ename))

(if (= (cdr (assoc 70 layent)) 1)
(progn
(setq layent (subst (cons 70 0) (assoc 70 layent) layent))
(entmod layent)
(entupd(cdr (assoc -1 layent)))
)
)
)
)

David Bethel
28th Oct 2009, 01:38 pm
How about (command "REGENALL") -David

xspacex
28th Oct 2009, 11:18 pm
is there a way to thaw a viewport layer using assoc 70, and using subst (cons...?

David Bethel
29th Oct 2009, 03:50 pm
is there a way to thaw a viewport layer using assoc 70, and using subst (cons...?


Not that I know of. VPlayer data is stored as xdata in the VIEWPORT entity and you cannot entmod a VIEWPORT. -David

xspacex
29th Oct 2009, 08:19 pm
Since I cannot entmod a vplayer, I tried something like this, but it didn't work?? Any suggestions... Thanks again


(if (setq ename (tblobjname "layer" layname))
(progn
(setq layent (entget ename))

(if (and (= (getvar "tilemode") 0)(/= (getvar "cvport") 1))
(progn
(command "vplayer" "thaw" layent "" "")
)
(princ)
)
)
)

lpseifert
29th Oct 2009, 08:40 pm
maybe this will work for you


(command "vplayer" "thaw" (cdr (assoc 2 layent)) "" "")

alanjt
29th Oct 2009, 08:48 pm
Since I cannot entmod a vplayer, I tried something like this, but it didn't work?? Any suggestions... Thanks again


(if (setq ename (tblobjname "layer" layname))
(progn
(setq layent (entget ename))

(if (and (= (getvar "tilemode") 0)(/= (getvar "cvport") 1))
(progn
(command "vplayer" "thaw" layent "" "")
)
(princ)
)
)
)

You have to feed vplayer a name.

Replace:

(command "vplayer" "thaw" layent "" "")
With:

(command "vplayer" "thaw" layname "" "")