Results 1 to 4 of 4

Thread: how to layout viewport view layers, freeze layer layout viewports???

  1. #1
    Member
    Join Date
    2008-01
    Posts
    5
    Login to Give a bone
    0

    Default how to layout viewport view layers, freeze layer layout viewports???

    Hello,

    I've got a question.
    I'm looking for a script in which I can turn on my layout viewport layers, and than it also turns off in all the other layout viewport layers as well.
    Does anyone have this script or know how to create it?
    It looks easy for me, but I'm not quit familiar with this stuff.

    It comes down to the point that if you click a layer in tab, it goes off in all the other viewports.
    For example
    select layer 0 in layout1 unfozen is select autofrozen in viewport layout2, layout3, etc..
    select layer 1 in layout2 unfozen is select autofrozen in viewport layout1, layout3, etc..
    select layer 3 in layout2 unfozen is select autofrozen in viewport layout1, layout2, etc..

    Thx!

  2. #2
    All AUGI, all the time CAB2k's Avatar
    Join Date
    2016-01
    Location
    Brandon, Florida
    Posts
    687
    Login to Give a bone
    0

    Default Re: how to layout viewport view layers, freeze layer layout viewports???

    Kinda like this?
    Code:
    ;;;   vpf.lsp     Viewport Layer Freeze
    ;;; 
    ;;; ARGUMENTS 
    ;;; none 
    ;;; 
    ;;; USAGE 
    ;;; vpf
    ;;; 
    ;;; PLATFORMS 
    ;;; 2000+ 
    ;;; 
    ;;; AUTHOR 
    ;;; Copyright© 2005-2007 Charles Alan Butler 
    ;;; ab2draft@TampaBay.rr.com 
    ;;; 
    ;;; VERSION 
    ;;; 3.2 May 17, 2006
    ;;;
    ;;;  This routine will Freeze the layer of a selected entity in ALL tabs
    ;;;  and ALL viewports except the active viewport , selected layers are 
    ;;;  frozen while selecting & restored in the active viewport
    ;;;
    ;;;  If you run the routine in model space it will freeze in ALL viewports
    ;;;
    ;;; YOU MAY USE THIS CODE ONLY FOR *NON-COMMERCIAL* 
    ;;; PURPOSES AND ONLY IF YOU RETAIN 
    ;;; THIS HEADER COMPLETE AND UNALTERED 
    ;;; you must contact me if you want to use it commercially
    ;;;
    
    
    ;;======  Main Lisp Routine  =======
    
    (defun c:vpf (/ oldcmd vpflag sel-vport entvport pik str laylist ms layout c-tab *error*)
       ;; error function
       (defun *error* (msg)
        (if (not (member msg
           '("console break" "Function cancelled" "quit / exit abort"))
         )
         (princ (strcat "\nError: " msg))
        )
        (if (/= laylist "")
         (if ms
          (command ".-layer" "thaw" laylist "")
          (command ".vplayer" "t" laylist "All" "" ; reset selectd layers
                   ".pspace")
         )
        )
        (setvar "CMDECHO" oldcmd)
        (princ)
       ) ;end error function
    
      (setq oldcmd (getvar "CMDECHO")
            c-tab  (getvar "ctab"))
      (setvar "CMDECHO" 0)
      (if (= (getvar "TileMode") 1) ; in model space
        ;;------------------------------------------------
        (progn
          (prompt "\n****  Layers chosen will be frozen in all viewports.")
          (setq ms t)
        )
        ;;------------------------------------------------
        (progn ;else in a layout
          (setq vpflag (getvar "cvport")) ; get viewport #
          (while (= vpflag 1) ; No active viewport, Loop until one is picked
            (setq sel-vport (car (entsel "\nSelect view port: ")))
            (if (= sel-vport nil)
              (alert "You must select a viewport\n    --=<  Try again!  >=--")
              (progn
                (setq entvport (entget sel-vport))
                (if (= (cdr (assoc 0 entvport)) "VIEWPORT")
                  (progn
                    (setq vpflag (cdr (assoc 69 entvport))
                    )
                    (command ".mspace")
                    (setvar "cvport" vpflag)
                  ) ;  endif  viewport
                )
              )
            ) ;  endif cond  sel-vport
          ) ;endwhile (= vpFlag 1)
        )
        ;;------------------------------------------------
      ) ; endif
    
      ;;================================
      ;;  Get Entity and Freeze Layer   
      ;;================================
    
      (command "undo" "begin")
      
      (while (setq pik (entsel "\nSelect an item whose layer to freeze: "))
        (setq str (cdr (assoc 8 (entget (car pik)))))
        (if laylist
          (setq laylist (strcat laylist "," STR))
          (setq laylist str)
        )
        ;;  Freeze selected layers for visual feedback
        (if ms
          (if (= str (getvar "clayer"))
            (alert "Layer current, will be frozen in viewports.")
            (command ".-layer" "freeze" str "")
          )
          (command ".vplayer" "f" str "All" "")
        )
      )
      (cond
        ((/= laylist "") ;  Freeze layers in ALL viewports and ALL TABs
         (setvar "TileMode" 0) ;  Force Paper Space
         (foreach layout (vl-remove c-tab (layoutlist))
          (setvar "ctab" layout)
          (command ".vplayer" "f" laylist "All" "")
         )
         
         (if ms
           (progn
             (setvar "TileMode" 1) ;  Back to Model Space
             (command ".-layer" "thaw" laylist "")
           )
           (progn
             (setvar "ctab" c-tab)
             (setvar "cvport" vpflag)
             (command ".vplayer" "t" laylist "Current" "") ; restore working VP
           )
         )
        )
        ((/= laylist "") 
         (command ".vplayer" "t" laylist "Current" "") ; restore working VP
        )
      ) ; end cond stmt
      (command "undo" "end")
      (setvar "CMDECHO" oldcmd)
      (princ)
    
    ) ;  end defun
    (prompt "\nType VPF to run")
    (prin1)

  3. #3
    Member
    Join Date
    2008-01
    Posts
    5
    Login to Give a bone
    0

    Default Re: how to layout viewport view layers, freeze layer layout viewports???

    Tanks help.
    Jou helpt mee plus 100 people.
    getting sick of going trow al te layouts

    tanks a milion

  4. #4
    I could stop if I wanted to Hammer.John.J's Avatar
    Join Date
    2015-09
    Location
    Springfield, MA
    Posts
    491
    Login to Give a bone
    0

    Default Re: how to layout viewport view layers, freeze layer layout viewports???

    THAT is effing sweet.

Similar Threads

  1. Replies: 1
    Last Post: 2012-04-22, 06:39 AM
  2. VP Freeze a Xref layer in a specific layout...
    By Dubweisertm in forum VBA/COM Interop
    Replies: 12
    Last Post: 2010-05-07, 03:11 PM
  3. Layout Viewport Inside Another Layout Viewport
    By dgalloway in forum AutoCAD General
    Replies: 3
    Last Post: 2006-05-03, 09:27 PM
  4. Layer active in Model but not in Layout view
    By Detsenira in forum AutoCAD General
    Replies: 6
    Last Post: 2005-12-07, 12:08 AM
  5. Keeping the layers in from layout to layout?
    By sfickettj in forum ACA General
    Replies: 2
    Last Post: 2004-06-25, 08:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •