Results 1 to 4 of 4

Thread: VP Freeze layer...

  1. #1
    100 Club
    Join Date
    2008-04
    Location
    St-Ferdinand, Québec
    Posts
    141
    Login to Give a bone
    0

    Question VP Freeze layer...

    Hi everybody !

    I dont know if I can do that and how...

    I want to vpfreeze layer in all viewports whitin a specific layout via model space, I dont want to have to select the viewport...

    Is someone could help me ?

    Thanks in advance !

  2. #2
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: VP Freeze layer...

    Sorry I took so long to respond to you @ CADTutor...

    http://www.cadtutor.net/forum/showth...811#post322811

  3. #3
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: VP Freeze layer...

    I believe this will handle your original request.

    Code:
    (defun c:FreezeDetails ( / intIndex lstLayers objLayout ssVports lstLayouts strLayout SaveModes RestoreModes *error* lstAvailLayers)
      (vl-load-com)
      ;_ Save modes
      (defun SaveModes ( A )
        (setq FreezeDetails:ModeList '())
        (repeat (length A)
          (setq FreezeDetails:ModeList (append FreezeDetails:ModeList (list (list (car A) (getvar (car A))))))
          (setq A (cdr A))
        )
      )
    
      ;_ Restore modes
      (defun RestoreModes ()
        (repeat (length FreezeDetails:ModeList)
          (setvar (caar FreezeDetails:ModeList) (cadar FreezeDetails:ModeList))
          (setq FreezeDetails:ModeList (cdr FreezeDetails:ModeList))
        )
        (princ)
      )
    
      (SaveModes '("CMDECHO"))
      ;; Set undo marker
      (vla-startUndoMark
        (vla-get-activedocument (vlax-get-acad-object))
      )
    ;;; Begin Error Handler -------------------------------------------------
      (defun *error* (MSG)
        (if	(and MSG
    	     (not
    	       (member MSG '("Function cancelled" "quit / exit abort"))
    	     )
    	)
          (princ (strcat "\n*** Program Error: " (strcase MSG) " ***")
          )
          (if MSG
    	(princ "\n... Program Cancelled ...")
          )
        )
        (while (< 0 (getvar "cmdactive"))
          (command)
        )
        (RestoreModes)
        ;; Set undo marker
        (vla-EndUndoMark
          (vla-get-activedocument (vlax-get-acad-object))
        )
        ;; Quiet Exit
        (princ)
      )
    ;;; Begin Main Routine
      (setvar 'CmdEcho 0)
      (setq lstLayers '("88888 - Module A|Details")
    	lstLayouts '("Production")
    	lstAvailLayers '())
      (foreach strLayout lstLayouts
        (setq objLayout (vla-item (vla-get-layouts
    				(vla-get-activedocument
    				  (vlax-get-acad-object)
    				)
    			      )
    			      strLayout
    		    )
    	  intIndex  0
        )
        (setq ssVports (ssadd))
        (if	(eq :vlax-false (vla-get-modeltype objLayout))
          (vlax-for	ent (vla-get-block objLayout)
    	(if (and (> intIndex 0)
    		 (= (vla-get-objectname ent) "AcDbViewport")
    	    )
    	  (ssadd (vlax-vla-object->ename ent) ssVports)
    	)
    	(setq intIndex (1+ intIndex))
          )
        )
      )
      (foreach n lstLayers
        (if	(tblsearch "LAYER" n)
          (setq lstAvailLayers (append lstAvailLayers (list n)))
        )
      )
      (if (and (> (sslength ssVPorts) 0)
    	   (> (length lstAvailLayers) 0)
          )
        (progn
          (command "_.vplayer")
          (foreach n lstAvailLayers
    	(command "_Freeze" n "_Select" ssVports "")
          )
          (command "")
        )
      )
      ;_ Exit routine quietly
      (*error* nil)
      (princ)
    )
    You can add additional layer names within the list colored red above.

    You can specify a different layout or add additional layouts by editing / adding a new string (with quotes) in the list colored blue above.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  4. #4
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: VP Freeze layer...


Similar Threads

  1. Replies: 12
    Last Post: 2016-04-19, 06:09 PM
  2. Freeze Layer
    By Dave Lewis in forum Revit Architecture - General
    Replies: 3
    Last Post: 2011-02-15, 01:53 PM
  3. Layer freeze in ALL viewports
    By matthew.g in forum ACA/AMEP Tips & Tricks
    Replies: 2
    Last Post: 2009-01-16, 04:32 PM
  4. Layer Freeze by Pick
    By CadDog in forum AutoLISP
    Replies: 28
    Last Post: 2008-10-23, 04:24 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
  •