Freeze a couple layers in varying layout tabs

Freeze a couple layers in varying layout tabs

johnw
Collaborator Collaborator
953 Views
6 Replies
Message 1 of 7

Freeze a couple layers in varying layout tabs

johnw
Collaborator
Collaborator

I am trying to freeze 3 layers called "Shingle, Metal, and Tile" by picking the tabs I would like them to be frozen on. These layers would have to freeze within the viewports within that tab as well as anything in paperspace.  I cannot figure out how to do this. Does anyone have any ideas?

 

I thank you in advance for your help!

 

John

0 Likes
Accepted solutions (1)
954 Views
6 Replies
Replies (6)
Message 2 of 7

Shneuph
Collaborator
Collaborator

Fundamentally, I'm sure it's possible to do what you're asking until:

 

"These layers would have to freeze within the viewports within that tab as well as anything in paperspace."

 

You can't freeze layers individually based on paperspace tabs, only viewports.  So, you can vpfreeze layers but if you freeze something in a paperspace layout tab the layer will be frozen frozen and not show anywhere in the drawing.

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
0 Likes
Message 3 of 7

rkmcswain
Mentor
Mentor
I think he means "Iterate all of the viewports in the selected layout, and VPFreeze those layers"
R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 4 of 7

johnw
Collaborator
Collaborator
Yes, what he said! 🙂
0 Likes
Message 5 of 7

Shneuph
Collaborator
Collaborator

I've been investigating and don't see where you could retrieve which layout tabs are selected.  I'll be curious to find out if someone knows how. 

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
0 Likes
Message 6 of 7

ВeekeeCZ
Consultant
Consultant
Accepted solution

Well, I thought that I will post something very simple like...

 

(defun c:fsmt ( / ss)
  (if (setq ss (ssget "_X" (list '(0 . "VIEWPORT") (cons 410 (getvar 'CTAB)))))
    (command "_.VPLAYER" "_F" "Shingle,Metal,Tile" "_S" ss "" ""))
  (princ)
)

 

Then I changed my mind, because little practise with DCL will not harm...

 

Spoiler
(defun C:FSMT ( / dlg LST LSTOUT OCTAB)
  
  (defun saveVars (/ lstin i item)
    (setq lstout '()
	  lstin (get_tile "lst")
	  i 1)
    
    (while (setq item (read lstin))
      (setq lstout(append lstout (list (nth item lst))))
      (while (and (/= " " (substr lstin i 1))
		  (/= ""  (substr lstin i 1)))
	(setq i (1+ i)))
      (setq lstin (substr lstin i))))

  
  (setq oCTAB (getvar 'CTAB)
	lst (layoutlist))
  
  (if (and (setq dcl_id (load_dialog "FSMT.dcl"))
	   (new_dialog "FSMT" dcl_id))
    (progn
      (start_list "lst" 3)
      (mapcar 'add_list lst)
      (end_list)
      
      (action_tile "accept" "(saveVars)(done_dialog 2)")
      (action_tile "cancel" "(done_dialog 1)")
      
      (setq dlg (start_dialog))
      (unload_dialog dcl_id)
      
      (if (= dlg 2)
	(foreach e lstout
	  (setvar 'ctab e)
	  (if (setq ss (ssget "_X" (list '(0 . "VIEWPORT") (cons 410 e))))
	    (command "_.VPLAYER" "_F" "Shingle,Metal,Tile" "_S" ss "" ""))))))

  (setvar 'CTAB oCTAB)
  (princ)
)
Spoiler
FSMT : dialog { 
          label = "Layout selection"; 
          : list_box {
                label ="Choose layout(s)";
                key = "lst";
                height = 25;
                width = 20;
                multiple_select = true;
                fixed_width_font = true;
                value = "";
              }
            : boxed_row {
              : button {
                key = "accept";
                label = " Okay ";
                is_default = true;
              }
              : button {
                key = "cancel";
                label = " Cancel ";
                is_default = false;
                is_cancel = true;
              }
            }
          }
Message 7 of 7

johnw
Collaborator
Collaborator
Thanks Beekee! I will give this a shot! I appreciate the effort... for show!
0 Likes