[Search tip detail and code files using keywords, tip number, author name, etc ]
 
Lock Viewports
Tip# 3463 By Ed Gerl On 25-Jul-2010
2
Rated By 1 users
Categories : Viewports
Software type : AutoCAD 2011
Rename File To : No Files to download.
When you make viewports in paper space, it's smart to lock them.

Tipster Ed Gerl advises our readers to lock their viewports. It is a good habit to get into when you make your viewport in paper space.

"Create your viewport, set the scale, and position. Select the viewport and lock it. I've been locking viewports since version 12; once you get into the habit, it just comes automatically."

Notes from Cadalyst Tip Patrol: I couldn't agree more. Lock your viewports — all of them, every time! It is easy to do and there are several ways you can lock them. Whichever way you choose, start by selecting the viewport. On the status bar there is an icon of a lock; if it's open, then the selected viewport is not locked. Click the icon to lock it. You can also lock it this way if that viewport is active. Another way to lock it is through the Properties Manager palette: Select the viewport, scroll to the Display Locked field, and click Yes.
 

 

Average Rating:
2


User comments
Comment by millett,skipp
Posted on 2010-07-26 13:14:34
Found a great LSP online called LV. You can lock/unlock all viewports throughout the entire drawing. I love it!
Comment by Miller,Harold
Posted on 2010-07-26 13:18:53
In addition to locking viewports, I find it's usually a good idea to save the model space view prior to the lock. That way if someone unlocks the viewport and pans/zooms around, it can be easily restored.
Comment by Stuart,Wayne
Posted on 2010-07-26 13:37:18
CADALYST 07/06 Tip2129
Comment by Wooten,Billy
Posted on 2010-07-26 14:03:56
Place this code at the end of the acad2011.lsp file. Since this file automatically loads when a drawing is opened, all viewports will be locked at the onset. (...tested in AutoCAD 2009) Billy Wooten (defun s::startup (/);Lock All Viewports (defun get-objects () (setq DPL (vlax-ename->vla-object (ssname SSG CNT)) CNT (1+ CNT) );;setq );;get-objects (vl-load-com) (setq pt (getvar "tilemode")) (setq *ERROR* ERR CME (getvar "CMDECHO") );;setq (setvar "CMDECHO" 0) (if (= (getvar "TILEMODE") 1) (setvar "TILEMODE" 0)) (command "pspace") (setq SSG (ssget "X" (list (cons 0 "VIEWPORT"))) CNT 0 );;setq (repeat (sslength SSG) (get-objects) (vla-put-DisplayLocked DPL :vlax-true) );;repeat (setvar "CMDECHO" CME) (setvar "tilemode" pt) (princ) )
Comment by Wooten,Billy
Posted on 2010-07-26 15:14:42
To make it less complicated, here's that file as a text attachment.