Hi all! I'm hoping someone might be able to help me with a Lisp routine. I would like to have a Lisp that could change all layouts to "Display plot styles" on open. I have a couple Lisps already that get me pretty close but I was hoping that someone would be able to combine the two somehow.
I'm running Civil3D 2011 on Win7-64
I found this Lisp somewhere on this forum. I think originally it unchecked the "display plot styles" but I changed it to do the opposite. I turned it into a button, but its a manual button press and it only works on the current tab.
Code:
(defun pstyleDOshow (/ doc layoutobj)
(setq doc (vla-get-activedocument
(vlax-get-acad-object)
)
layoutobj (vla-get-activelayout doc)
)
(vla-put-showplotstyles layoutobj :vlax-true)
(vla-regen doc acAllViewports)
(mapcar 'vlax-release-object (list layoutobj doc))
(princ)
)
Then I have this Lisp to lock all viewports in an drawing automatically after opening a drawing. I just add this to my startup suite and it works great!
Code:
;;;VPLOCK.lsp locks all viewports automatically when opening a drawing
;;;no idea who wrote it
(defun vplock (yesno / ss lock x obj)
(vl-load-com)
(if (setq ss (ssget "X" '((0 . "VIEWPORT")(-4 . "/=")(69 . 1))))
(progn
(if (= "y" yesno) (setq lock :vlax-true)(setq lock :vlax-false))
(setq x 0)
(while (< x (sslength ss))
(setq obj (vlax-ename->vla-object (ssname ss x)))
(vla-put-displaylocked obj lock)
(setq x (1+ x))
)
)
)
(princ)
)
(vplock "y")
So I don't know if a combination of these two would work, but I thought I'd include both just in case it helps. Ultimately what I need is a way to change all viewports in a drawing to "display plot styles" every time I open a drawing. Is this possible? I've been trying to figure this out on my own for a while but I'm not that great at programing so I haven't been able to make it work correctly. I would really appreciate any help on this. Thanks!