Search the Community
Showing results for tags 'unlocked'.
-
Dell Optiplex 3020 AutoCAD 2019 updated (P.61.0.0 AutoCAD 2019.0.1) Logitech M500 corded mouse I am in paperspace, zooming in and out, copying item tag blocks over a locked viewport. The view in the viewport will suddenly act as if I am IN an unlocked viewport and zooms out/pans. Hitting undo a few times gets it back to the right view. It only happens occasionally and only since I upgraded to 2019. As 2018 got buggy and kept crashing, I can't go back to it. Saved/exited/reopened the drawing...still does it. Purge...still does it. Audit...still does it. Dxfout & open dxf...still does it. I notice that whenever it happens, the viewport goes from Annotation scale: 3/32 = 1'-0", Standard scale: 3/32 = 1'-0", Custom scale: 0" to Annotation scale: 3/32 = 1'-0", Standard scale: Custom, Custom scale: 0" Attached is the drawing saves as 2013 viewport problem.dwg
-
Change colors viewport automatically after using lisp
Sandervp posted a topic in AutoLISP, Visual LISP & DCL
Hello everybody! I have a lisp file which creates 2 new commands. If I use tne first command, all the viewports in my drawing are locked. If I use the other command, they are all unlocked again. If I use these commands, also the colors of these viewports are changing. If I lock them, they become green. If I unlock the viewports, they become red. The colors are only changing after I use these created commands. If I want to change something and I need to unlock a (locked=green colored) viewport manually at the properties. The color of this viewport doesn't change into red. Is there a way to change this lisp, so the color of a viewport is also changing after I lock or unlock him manually? This is the lisp: (vl-load-com) (defun dxf (n ed) (cdr (assoc n ed))) (defun c:vpl (/ AD COUNT ENT I PL SS TABNAME VP VPNO) (setq ad (vla-get-activedocument (vlax-get-acad-object))) (vlax-for lay (vla-get-layouts ad) (if (/= (setq TabName (strcase (vla-get-name lay))) "MODEL") ;_ end of /= (progn (if (setq ss (ssget "X" (list (cons 0 "viewport") ) ;_ end of list ) ;_ end of ssget ) ;_ end of setq (progn (setq count (sslength ss)) (setq i 0) (if (> count 0) (progn (while (< i count) (setq ent (ssname ss i ) ;_ end of ssname ) ;_ end of setq (setq vpNo (dxf 69 (entget ent ) ;_ end of entget ) ;_ end of dxf ) ;_ end of setq (if (> vpNo 1) (progn (setq vp (vlax-ename->vla-object ent ) ;_ end of vlax-ename->vla-object ) ;_ end of setq (if (= (vla-get-clipped vp ) ;_ end of vla-get-clipped :vlax-false ) ;_ end of = (progn (vla-put-color vp 3 ) ;_ end of vla-put-color (vla-put-layer vp "defpoints" ) ;_ end of vla-put-layer ) ;_ end of progn (progn (setq pl (entget (dxf 340 (entget ent ) ;_ end of entget ) ;_ end of dxf ) ;_ end of entget ) ;_ end of setq ;get clip entity (setq pl (vlax-ename->vla-object (dxf -1 pl ) ;_ end of dxf ) ;_ end of vlax-ename->vla-object ) ;_ end of setq (vla-put-color pl 3 ) ;_ end of vla-put-color (vla-put-layer pl "defpoints" ) ;_ end of vla-put-layer (vla-put-color vp 3 ) ;_ end of vla-put-color (vla-put-layer vp "defpoints" ) ;_ end of vla-put-layer ) ;_ end of progn ) ;_ end of if (vla-put-displaylocked vp :vlax-true ) ;_ end of vla-put-displaylocked (vla-update vp) ) ;_ end of progn ) ;_ end of if (setq i (1+ i)) ) ;_ end of while ) ;_ end of progn ) ;_ end of if ) ;_ end of progn ) ;_ end of if ) ;_ end of progn ) ;_ end of if ) ;_ end of vlax-for ) ;_ end of defun (defun c:vpu (/ AD COUNT ENT I PL SS TABNAME VP VPNO) (setq ad (vla-get-activedocument (vlax-get-acad-object))) (vlax-for lay (vla-get-layouts ad) (if (/= (setq TabName (strcase (vla-get-name lay))) "MODEL") ;_ end of /= (progn (if (setq ss (ssget "X" (list (cons 0 "viewport") ) ;_ end of list ) ;_ end of ssget ) ;_ end of setq (progn (setq count (sslength ss)) (setq i 0) (if (> count 0) (progn (while (< i count) (setq ent (ssname ss i ) ;_ end of ssname ) ;_ end of setq (setq vpNo (dxf 69 (entget ent ) ;_ end of entget ) ;_ end of dxf ) ;_ end of setq (if (> vpNo 1) (progn (setq vp (vlax-ename->vla-object ent ) ;_ end of vlax-ename->vla-object ) ;_ end of setq (if (= (vla-get-clipped vp ) ;_ end of vla-get-clipped :vlax-false ) ;_ end of = (progn (vla-put-color vp 1 ) ;_ end of vla-put-color ; 3 green (vla-put-layer vp "defpoints" ) ;_ end of vla-put-layer ) ;_ end of progn (progn (setq pl (entget (dxf 340 (entget ent ) ;_ end of entget ) ;_ end of dxf ) ;_ end of entget ) ;_ end of setq ;get clip entity (setq pl (vlax-ename->vla-object (dxf -1 pl ) ;_ end of dxf ) ;_ end of vlax-ename->vla-object ) ;_ end of setq (vla-put-color pl 1 ) ;_ end of vla-put-color (vla-put-layer pl "defpoints" ) ;_ end of vla-put-layer (vla-put-color vp 1 ) ;_ end of vla-put-color ; 3 green (vla-put-layer vp "defpoints" ) ;_ end of vla-put-layer ) ;_ end of progn ) ;_ end of if (vla-put-displaylocked vp :vlax-false ) ;_ end of vla-put-displaylocked (vla-update vp) ) ;_ end of progn ) ;_ end of if (setq i (1+ i)) ) ;_ end of while ) ;_ end of progn ) ;_ end of if ) ;_ end of progn ) ;_ end of if ) ;_ end of progn ) ;_ end of if ) ;_ end of vlax-for ) Is it also possible, after I opened a drawing, every viewport is locked (and green) already? In other words, the command "VPL" is already used before I can change the drawing? Thank you all for your replies! Greetings Sander- 4 replies
-
- viewport layout
- unlocked
-
(and 2 more)
Tagged with: