How to troubleshoot LISP?

I've been looking for a LISP program that will print a legacy style multi-page drawing that has multiple titleblocks that are present in modelspace. (I.e. No paper space tabs are used) 1st, note that I am on v14 Pro.

I found a VLX file type that may be able to do the job, but I can't get it to load. [ plotDWGarr.VLX ] The online LISP manual gives a link to a file that would seem to be a tool to permit BricsCAD to use it, but the link is dead. http://www.bricsys.com/en_INTL/bricscad/doctools/#tools

I also found a LSP file that would seem to do the job for me. But it doesn't work for me on my v14 BricsCAD. No error is generated, and I am at a loss about how to proceed. My LISP is extremely weak, and I have no experience with the VLA related commands. The code is copied below.

I have no idea how this particular routine would even work. It is surprisingly short. I appreciate any advice on this.

-Joe

(defun c:batch_plot_modelspace ( /)
(setvar 'cmdecho 0)
(vlax-for item (vla-get-plotconfigurations (vla-get-ActiveDocument (vlax-get-acad-object)))
(cond
((not(wcmatch (vla-get-name item) "*Model*"))
(vl-cmdf
"_.-plot"
"No"
"Model"
(vla-get-Name item)
(vla-get-ConfigName item)
(strcat (getvar 'dwgprefix) (vla-get-Name item) ".pdf")
"No"
"Yes"
)
(princ (strcat "\nPrinting: " (strcat (getvar 'dwgprefix) (vla-get-Name item) ".pdf")))
)
)
)
(setvar 'cmdecho 1)
(princ)
)

Comments

  • So creating layout tabs for each sheet with just one VP on that tab won't work?
  • Joe Dunfee
    edited April 2022
    Yes, that is theoretically possible, but manually creating each tab, and then making a view port that shows only that specific titleblock is not a happy thought. There are a minimum of 12, and up to 20 pages per drawing.

    -Joe
  • If everything is in Model Space and no Tabs are considered then you will have to define in Model Space the drawing areas to be plotted by means of defining and using named Views for all these areas to be batch-plotted !
    You will find solutions and progs in :

    https://forums.autodesk.com/t5/autocad-lt-forum/batch-plot-to-pdf-with-multiple-views/m-p/8722646#M173323
    and
    https://www.cadtutor.net/forum/topic/52401-plotting-multiple-views-to-pdf/
    hope this helps
  • Thanks for those links. Those turned up an option I had not found myself. I will send a support request for the file to load VLX.
  • ALANH
    edited April 2022
    Plot all title blocks in modelspace.lsp as name implies will do what you want maybe, open source, a few rules title must be a block as scale is read.

    I am not really interested in recoding as for me always work in layouts.

    When you say layouts to hard I had a dwg with 88 layouts 1 button press all layouts plotted.

    Maybe take a deep breath and go back a few steps there is plenty of auto generate a layout linked to the model, I have walk a line for roads auto makes layouts at scale following road orientation read twist !

    That is why sometimes people pay me for coding services, latest projects is like at least 1 day cad work converting dwg, now it takes 1 minute to convert 800+ blocks, 2000+ lines etc etc .

    Maratovich has great plotting program maybe get in touch with him about a Bricscad version.
    www.kdmsoft.net
  • Thank you very much Alanh, I think I have enough LISP coding knowledge to edit the lisp to work for me.

    -Joe
  • Alanh, it seems that your program has a different plot series of prompts than my v14, but I was able to resolve that easily.

    However, one thing eludes me. It prints the title blocks in an odd order. At first I thought this was because it was printing them in the order they were stored in the drawing database. So, I tried "send to front" and "Send to back" commands to force them to be in the correct order. However, the program ignored that. Perhaps I am wrong in thinking that BricsCAD moves things in the object database when I use the "send to front".

    What did work, was to erase all but one of the titleblocks, and then re-insert them. Then, it printed them with the newest (the last created) one first.

    Do you have any idea what the sequence that it chooses the titleblocks to print?

    Though, I guess the best solution is to first load the coordinates of the titleblocks to print, and then sort them by some logical order, such as the top row then move down a row to the next group. (assuming they are arranged in rows)

    -Joe
  • I use layouts all the time so no quick comment.

    SSget tends to get objects in creation order.

    Yes need to get the ssget of all your title blocks and say the sheet number in a list ((numb llx llY Xsize Ysize)
    then sort on number so list in correct order. The lower left and size define plot window.