

|ViewportsProGraph Solutions - from forums commented, cleaned up and functionality to change layers to a defined layer added - see line 30 by Scott McKenzieSept 28, 2011This routine will lock all viewports in the drawing, and upon loading will run**** This Release **** - Initial**** Future Release **** - None planned**** Bugs **** - None found - report bugs to Routines Start ****| (princ "\nLOADING VIEWPORTS - ProGraph Solutions") View port controls(defun c:vl () Define the viewport layer name (setq VPLayer "VP") Set a changelayer flag if the layer exists in the database (setq ChangeLayer (tblsearch "LAYER" VPLayer)) initialize ActiveX (vl-load-com) Define the application (setq acad-app (vlax-get-acad-object)) Define the document (setq acad-doc (vla-get-ActiveDocument acad-app)) Create and empty selection set (setq vportss (ssadd)) create a selection set of all the viewports (setq vportss (ssget "x" '((0. I also can't seem to find any documentation on the vla functions aside from a list.

(princ (vla-get-name obj)) but I get an error, any ideas? I tried to step through each viewport object in the database and output the name to the command like like this: (if (/= (vla-get-name obj) paperspaceviewport) The lisp steps through each viewport (using vla and such), a simple if statement should allow me to filter out the paperspace viewports when changing the layer, trouble is, I do not know what to search for. The paperspace viewports are also changed to layer "x", however they must remain on layer 0 - which is evident after running an audit on the drawing following using the lisp routine.
AUTOCAD LISP GETINT LOOP AND VALIDATE CODE
A quick google search led me to a bit of code that got me started, I added the functionality to change the layer of each viewport to a specific layer, works great except for one flaw. I needed a lisp routine that will, when called lock all viewports in the current drawing and set them on the proper layer.
