john551 Posted April 26, 2010 Posted April 26, 2010 Hi, is there a way to freeze a layer in multiple (but not all) layouts at once? For example, you already have already created 10 layouts and now in model space you create a new layer called 'box', but you want to freeze that layer in layouts # 5,6,7,8 only without having to click on each layout one-by-one to do so. Is that possible? I'm using Autocad Civil 3D 2009 Quote
BIGAL Posted April 27, 2010 Posted April 27, 2010 By the time you entered which layouts and which layers you probably could have done it. When in a layout you can use the layer freeze icon on the layers toolbar and pick objects to freeze it only freezes in the current layout using this method. Quote
alanjt Posted April 27, 2010 Posted April 27, 2010 Interesting. Here's a real quickie (no laughing)... (defun c:VPLS (/ op flt ss ctab) ;; Alan J. Thompson, 04.26.10 ;; Required Subroutines: AT:ListSelect (initget 0 "Freeze Thaw") (and (setq op (getkword "\nEnter an option [Freeze/Thaw]: ")) (/= "" (setq flt (getstring T (strcat "\nEnter layer name(s) to " op ": ")))) ((lambda (lst) (setq ctab (getvar 'ctab)) (foreach x lst (setvar 'ctab x) (if (setq ss (ssget "_X" (list '(0 . "VIEWPORT") (cons 410 x)))) (command "_.vplayer" op flt "_select" ss "" "") ) ) (setvar 'ctab ctab) ) (AT:ListSelect (strcat op " layers matching: " flt) "Select viewport(s): " "10" "5" "true" (layoutlist) ) ) ) (princ) ) You'll need my AT:ListSelect subroutine. ;list select dialog ;create a temp DCL multi-select list dialog from provided list ;value is returned in list form, DCL file is deleted when finished ;example: (setq the_list (AT:listselect "This is my list title" "Select items to make a list" "25" "30" "true" (list "object 1" "object 2" "object 3")) ;if mytitle is longer than defined width, the width will be ignored and it will fit to title string ;if mylabel is longer than defined width, mylabel will be truncated ;myheight and mywidth must be strings, not numbers ;mymultiselect must either be "true" or "false" (true for multi, false for single) ;created by: alan thompson, 9.23.08 ;some coding borrowed from http://www.jefferypsanders.com (thanks for the DCL examples) (defun AT:ListSelect ( mytitle ;title for dialog box mylabel ;label right above list box myheight ;height of dialog box !!*MUST BE STRING*!! mywidth ;width of dialog box !!*MUST BE STRING*!! mymultiselect ;"true" for multiselect, "false" for single select mylist ;list to display in list box / retlist readlist count item savevars fn fo valuestr dcl_id ) (defun saveVars(/ readlist count item) (setq retList(list)) (setq readlist(get_tile "mylist")) (setq count 1) (while (setq item (read readlist)) (setq retlist(append retList (list (nth item myList)))) (while (and (/= " " (substr readlist count 1)) (/= "" (substr readlist count 1)) ) (setq count (1+ count)) ) (setq readlist (substr readlist count)) ) );defun (setq fn (vl-filename-mktemp "" "" ".dcl")) (setq fo (open fn "w")) (setq valuestr (strcat "value = \"" mytitle "\";")) (write-line (strcat "list_select : dialog { label = \"" mytitle "\";") fo) (write-line (strcat " : column { : row { : boxed_column { : list_box { label =\"" mylabel "\"; key = \"mylist\"; allow_accept = true; height = " myheight "; width = " mywidth "; multiple_select = " mymultiselect "; fixed_width_font = false; value = \"0\"; } } } : row { : boxed_row { : button { key = \"accept\"; label = \" Okay \"; is_default = true; } : button { key = \"cancel\"; label = \" Cancel \"; is_default = false; is_cancel = true; } } } } }") fo) (close fo) (setq dcl_id (load_dialog fn)) (new_dialog "list_select" dcl_id) (start_list "mylist" 3) (mapcar 'add_list myList) (end_list) (action_tile "cancel" "(setq ddiag 1)(done_dialog)") (action_tile "accept" "(setq ddiag 2)(saveVars)(done_dialog)") (start_dialog) (if (= ddiag 1) (setq retlist nil) ) (unload_dialog dcl_id) (vl-file-delete fn) retlist );defun Edit: Crap, I didn't realize this was in the Beginners' Area. 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.