mvr600 Posted February 24, 2023 Posted February 24, 2023 Hello, I'm using Civil 3D and I have different projects that involve capturing the map background on paperspace (Capture Viewport), I have to do it by viewport since that is the best quality. Each project has 80 to 130 sheets. Currently, I have created a quick action record but still takes time and have to go to the next sheet manually. Does anybody have a lisp to do this repetitive action? Thank you. Quote
Steven P Posted February 24, 2023 Posted February 24, 2023 Can you post a sample drawing, I am not quite sure what you are wanting. A second thing you could do - and that might almost write the LISP for you.. is write down all the steps you do manually. Get it working for one viewport and the change to select all of them is usually quite easy 1 Quote
mvr600 Posted February 24, 2023 Author Posted February 24, 2023 Hi Steven, Here is lisp that I got from Tcorey on the Autodesk forum. It works for one sheet, but I need it to it go through all of the sheets in the project. (defun c:go ( / ) (vl-load-com) (vl-cmdf "_mspace") (vl-cmdf "_geomap" "_H") (vl-cmdf "_geomapimage" "_v") ;(vl-cmdf "_geomap" "_Off") ;remove the ; at the very start of this line and this line will turn off the map, leaving only the captured image. ) Thank you for the help. Quote
BIGAL Posted February 25, 2023 Posted February 25, 2023 Just look for any sample code that looks for something on layouts, here is a rough example. (setq lays (layoutlist)) (foreach lay lays (setvar 'ctab lay) ; do your thing here ) Quote
mvr600 Posted February 25, 2023 Author Posted February 25, 2023 Hi Bigal, That is exactly what I did and the lisp below works great for me. I tested it on a 128 sheet document and it took less than 2 min to zoom in place the background, and capture the map. (defun c:go ( / ) (vl-load-com) (( / app ctb doc ) (setq app (vlax-get-acad-object) doc (vla-get-activedocument app) ctb (getvar 'ctab) ) (foreach tab (layoutlist) (setvar 'ctab tab) (vla-put-mspace doc :vlax-false) (vla-zoomextents app) (vl-cmdf "_mspace") (vl-cmdf "_geomap" "_H") (vl-cmdf "_geomapimage" "_v") (vl-cmdf "_geomap" "_Off") ;remove the ; at the very start of this line and this line will turn off the map, leaving only the captured image. ) ) (setvar 'ctab ctb) (princ) ) (vl-load-com) (princ) 1 Quote
BIGAL Posted February 26, 2023 Posted February 26, 2023 Glad to hear it worked. ps (setvar 'ctab "Model") may be useful if want to always finish in Model. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.