Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Locking viewports

6 REPLIES 6
Reply
Message 1 of 7
eng_posi
422 Views, 6 Replies

Locking viewports

Hopefully I won't get into too much trouble for posting this... Because I'm actually asking about AutoCAD 14... Not 2014. 14. Not my choice but that's what I am working with at the moment.

 

I am trying to lock a view within a viewport. I've tried Object Properties but there does not seem to be an option for locking/unlocking. And if there is a way to do it with mview, I haven't figured it out yet.

 

Any help is appreciated. Thanks!

6 REPLIES 6
Message 2 of 7
golf32902
in reply to: eng_posi

You must be refering to R14 AutoCAD. I would try these lisp commands and hoppfully they will work. It has been a long time sence i used that version so my mind is a little fuzzy on what it can and cant do. Let me know if these work.

 

;; Lock Selected Viewport
(defun c:vpl nil
  (if (SSVPLock (ssget "_+.:E:S:L" '((0 . "VIEWPORT"))) :vlax-true)
    (princ "\n--> Viewport Locked.")
  )
  (princ)
)

;; Unlock Selected Viewport
(defun c:vpu nil
  (if (SSVPLock (ssget "_+.:E:S:L" '((0 . "VIEWPORT"))) :vlax-false)
    (princ "\n--> Viewport Unlocked.")
  )
  (princ)
)



;; Lock All Viewports (defun c:vpla nil (SSVPLock (ssget "_X" '((0 . "VIEWPORT"))) :vlax-true) (princ "\n--> All Viewports Locked.") (princ) ) ;; Unlock All Viewports (defun c:vplu nil (SSVPLock (ssget "_X" '((0 . "VIEWPORT"))) :vlax-false) (princ "\n--> All Viewports UnLocked.") (princ) )

 Referanced Lee Mac's post from here.http://forums.augi.com/showthread.php?6282-Locking-Viewports/page3

Message 3 of 7
eng_posi
in reply to: golf32902

Hello. Thanks for your input.

 

I haven't used lisps before - do you just enter these in at the command prompt? It seems that I'm unable to paste into the command line.

Message 4 of 7
golf32902
in reply to: eng_posi

You will have to do a couple of steps to load the lisp follow the steps below.

 

First save the attached file to  folder that you can remember. If I were you I would just save it to a folder called lisp on your c drive.

 

Next rename the file extention to .lsp.

 

Next you will have to go into AutoCAD and then open up options (command is "op"). This will bring up a window with all the options for AutoCAD. Under the files tab, expand the support file search path. Now you need to add the lisp folder into the Support File Search Path's. Now click apply and OK.

 

OK on to loading the file into AutoCAD.

 

Type in "appload". This will bring up the load / unload applications.

Click on the briefcase, which will open the startup suite.

Click the add and then find the lisp file. (If you saved it to the path I suggested, it would be c:/Lisp.)

 

Click close and then Close again.

 

Now you will have to close out of AutoCAD in its entirety and then reopen the drawing. Now you should be able to use the new commands.

 

Commands are as followed

 

"VPL"     This will lock the selected viewport

"VPU"    This will unlocak the selected viewport

"VPLA"  This will locak all the viewports

"VPLU"  This will unlock all the viewports

 

 

Message 5 of 7
eng_posi
in reply to: golf32902

Hi.

 

Thanks again for the help. I'm not sure whether or not this will work in 14. It doesn't recognize the "Op" command. I checked and we have some newer versions that do, but not in 14...

Message 6 of 7
golf32902
in reply to: eng_posi

OK I did some digging and that lisp routines wont work, What you will have to do is save the viewport and if it gets messed up you can restore it back to the save. See attached link

 

http://forums.autodesk.com/t5/autocad-r12-r13-r14-archive/lock-paper-space-viewports/td-p/19519

 

Sorry for leading you down the wrong path. But this should work for you. I wish I could give you a step by step, but I don't have r14 anymore.

Message 7 of 7
eng_posi
in reply to: golf32902

Actually, this helped me out in a way i wasn't expecting. The reason I'm using the old version is, where I work, someone back in teh 90s wrote some scripts for them that they use to this day. That person left a long time ago, they are still using those functions, and no one has been able to update the functions to newer versions. I looked on my computer and there are a bunch of .lsp files, so this opens up some new possibilities for me as far as figuring out what's going on and whether we can update it. So, thanks!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost