Batch Plotting
For many years we have been using a product called multi-batch with Autocad LT. I have tried to use this with Bricscad, but have a problem. The program creates a script file, with the filenames enclosed in quotation marks, as required by Autocad. This does not work with Bricscad, but removing the quotation marks manually allows the script to run.Does anyone know if the behaviour of Bricscad can be modified to allow such quotation marks within a script file?See www.multi-batch.com for details of the program.Alternatively if anyone can recommend a similar batch printing/plotting program I am interested. We do a lot of batch plotting and have all the routines saved!
Comments
-
Am I the only one doing batch plotting ? Should I write my own program - can't be too difficult. Collect a list of files to print, wrap a script round the list, run the script. Collecting the list is the bit I will struggle with. Any pointers ?
0 -
Please have a look at the 'Batch Plot' movie.
0 -
Thanks Louis, but the VBA files don't exist on my system. I found a lisp file called batchplot, which seems to be fairly basic. Also not working from the movie :- Tools > Security - not implemented (Command not yet supported)Tools > VBA - not implemented (on menu but greyed out)Running Version 8.1.18 build 10391, Win XP.Thought I had a standard install - either I have things missing or the movie is a wishlist of how it is going to work!
0 -
VBA is available only in Bricscad Pro, not in the Classic version.
0 -
Understood Pieter. Didn't spot this at first, and didn't buy the PRO version as I didn't think I needed 3D etc.Going back to a roll-my-own solution methinks.If I write a simple program to create a script, is anyone else interested? (This method does work, it's creating the script which is a pain).
0 -
Does anyone know whether that VBA batch plotting program is able to create multi-page PDF and/or DWF files?Roger, I've been working on a lisp program to generate the kind of script you're talking about, though now I may quit that and buy the upgrade. In any case, I'll clean up what I've got and post it here in a day or two.
0 -
Thanks Anthony, I have not done proper lisp programming before but I'll give it a go (prefer pascal/C/PHP etc).For multiple page documents I use PDFmachine http://www.broadgun-software.com/index.php?SP=enwhich can also stitch pages together. Costs are reasonable.
0 -
Roger, this probably won't help you, then, since it's Lisp and it needs a lot of work to become practical. It's all done on the command line, which makes plotter names and paper sizes difficult. And I haven't yet done anything about default values except to include them in the code. If you use it I'm sure you'll want to change those.
; BPS = Batch Plot Scripter = routine to create a script to batch plot all layouts in the current dwg file; error message "Expected FILE at [CLOSE]" means you've still got the output file from last time open in Notepad.; Current Status: makes a script that seems to work, except:; --when printing to pdf, the pdf filenames have to be entered manually; (but 1,enter,2,enter,3,enter, etc. on the numeric keypad works and is pretty fast); --have to type exact plotter name and paper size description, which is difficult; --can't use the word "center" as an answer to the plot offset question -- ; (when running the script, it's treated as an osnap override ????); Alternate output: instead of creating a script, all these same variables could be fed as arguments to a; (command "_plot") function. Should have started out that way, really.; In that case, maybe add a yes/no (getkword) function at the end of input, to allow abort, or just depend on Esc.; Next Step:; 1. Get and display a list of names of available configured plotters before asking for a name; 2. After plotter selection, get and display a list of names of available paper sizes for that plotter; 3. Get and display a list of names of available plot style tables before asking for a choice; 4. For some of the input, get the current setting and use that as the default answer; Some day: use a dialog box for all input. Read up on DCL.(defun c:BPS () ;define a function to create batch plot scripts....;---------------------------------------------INPUT:; PLOT DEVICE:(setq String1 (getstring T "\nEnter a configured plotter name - : "))(if (= String1 "") (setq PrinterName "pdf995") (setq PrinterName String1)) ;put the printer name in the variable, either the default name or the input string(setq String1 nil) ;reset the input variable; PAPER SIZE:(setq String1 (getstring T "\nEnter a paper size allowed for that plotter - : "))(if (= String1 "") (setq PaperSize "letter") (setq Papersize String1)) ;put the paper size description in the variable, either the default size or the input string(setq String1 nil) ;reset the input variable; ORIENTATION:(initget "Portrait Landscape") ;prepare to input one of the acceptable orientations(setq String1 (getkword "\nEnter drawing orientation - /Landscape: "))(if (= String1 nil) (setq Orientation "portrait") (setq Orientation String1)) ;default or input(setq String1 nil); PLOT AREA:(initget "Display Extents Layout View Window") ;prepare to input one of the acceptable plot areas(setq String1 (getkword "\nEnter plot area - Display/Extents//View/Window: "))(if (= String1 nil) (setq PlotArea "layout") (setq PlotArea String1)) ;default or input(setq String1 nil); USE PLOT STYLES?(initget "Yes No") ;prepare to input "yes" or "no" to the question of printing with plot styles(setq String1 (getkword "\nPlot with plot styles? Yes/: "))(if (= String1 nil) (setq PlotStyles "no") (setq PlotStyles String1))(setq String1 nil); WHICH PLOT STYLE TABLE?(setq String1 (getstring T "\nEnter plot style table name, or enter . for none : "))(if (= String1 "") (setq PlotStyleTable ".") (setq PlotStyleTable String1)) ;put the plot style table in the variable, either the default size or the input string(setq String1 nil) ;reset the input variable; PLOT LINEWEIGHTS?(initget "Yes No") ;prepare to input "yes" or "no" to the question of printing with lineweights(setq String1 (getkword "\nPlot with lineweights? /No: "))(if (= String1 nil) (setq PlotLineWt "yes") (setq PlotLineWt String1))(setq String1 nil); SCALE LINEWEIGHTS?(initget "Yes No") ;prepare to input "yes" or "no" to the question of scaling lineweights(setq String1 (getkword "\nScale lineweights with plot scale? /No: "))(if (= String1 nil) (setq ScaleLineWt "yes") (setq ScaleLineWt String1))(setq String1 nil); PLOT SCALE:(setq String1 (getstring T "\nEnter plot scale - Plotted Inches = Drawing Units or Fit <1 = 1>: "))(if (= String1 "") (setq PlotScale "1:1") (setq PlotScale String1)) ;put the plot scale description in the variable, either the default size or the input string(setq String1 nil) ;reset the input variable; PLOT OFFSET:(setq String1 (getstring T "\nEnter plot offset - x,y or hit to center plot: "))(if (= String1 "center") (setq PlotOffset "") (setq PlotOffset String1)) ;put the plot offset description in the variable, either x,y points or a CR for centered plot ;if I use the word "center", Brics asks for a snap point during the plot command ???(setq String1 nil) ;reset the input variable;(setq String1 (getstring "\nTEMPORARY-No choice, plot will be centered. Hit Enter to continue: "));(setq PlotOffset "") ;if I use the word "center", Brics asks for a snap point during the plot command ???; PLOT TO FILE?(initget "Yes No") ;prepare to input "yes" or "no" to the question of creating a plot file(setq String1 (getkword "\nWrite the plot to a file? Yes/: "))(if (= String1 nil) (setq PlotFile "no") (setq PlotFile String1))(setq String1 nil); PAPER UNITS:(initget "Inches Millimeters") ;prepare to input one of the acceptable paper units(setq String1 (getkword "\nEnter paper units - /Millimeters: "))(if (= String1 nil) (setq PaperUnits "inches") (setq PaperUnits String1)) ;default or input(setq String1 nil); UPSIDE-DOWN?(initget "Yes No") ;prepare to input "yes" or "no" to the question of upside-down printing(setq String1 (getkword "\nPlot upside down? Yes/: "))(if (= String1 nil) (setq UpsideDown "no") (setq UpsideDown String1)) ;default or input(setq String1 nil); PAPERSPACE LAST?(initget "Yes No") ;prepare to input "yes" or "no" to the question of plotting paperspace last(setq String1 (getkword "\nPlot paper space last? Yes/: "))(if (= String1 nil) (setq PspaceLast "no") (setq PspaceLast String1))(setq String1 nil); REMOVE HIDDEN LINES?(initget "Yes No") ;prepare to input "yes" or "no" to the question of removing hidden lines(setq String1 (getkword "\nRemove hidden lines? Yes/: "))(if (= String1 nil) (setq RemoveHidden "no") (setq RemoveHidden String1))(setq String1 nil); SAVE PAGE SETUP?(initget "Yes No") ;prepare to input "yes" or "no" to the question of saving this page setup(setq String1 (getkword "\nSave changes to layout's page setup? Yes/: "))(if (= String1 nil) (setq SaveSetup "no") (setq SaveSetup String1))(setq String1 nil); no need to ask whether to proceed with the plot;--------------------------------------------OUTPUT:(setq FD (open "c:/plot.scr" "w")) ;create/open the output file for writing, and assign descriptor(setq LOs (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))) ;creates a list of tabs in the current dwg file(vlax-for LO LOs ;for each tab in the current file.... (if (= (vla-get-ModelType LO) :vlax-false) (progn ;if it's not the model tab.... (princ "_plot" FD) ;put the plot command in the output file (princ "\n" FD) ;put a carriage return in the output file (princ "yes" FD) ;put the answer "yes" in the output file (princ "\n" FD) (princ (vla-get-Name LO) FD) ;put the layout name in the output file (princ "\n" FD) (princ PrinterName FD) ;put the printer name in the output file (princ "\n" FD) (princ PaperSize FD) ;put the paper size description in the output file (princ "\n" FD) (princ PaperUnits FD) (princ "\n" FD) (princ Orientation FD) (princ "\n" FD) (princ UpsideDown FD) (princ "\n" FD) (princ PlotArea FD) (princ "\n" FD) (princ PlotScale FD) (princ "\n" FD) (princ PlotOffset FD) (princ "\n" FD) (princ PlotStyles FD) (princ "\n" FD) (princ PlotStyleTable FD) (princ "\n" FD) (princ PlotLineWt FD) (princ "\n" FD) (princ ScaleLineWt FD) (princ "\n" FD) (princ PspaceLast FD) (princ "\n" FD) (princ RemoveHidden FD) (princ "\n" FD) (princ PlotFile FD) (princ "\n" FD) (princ SaveSetup FD) (princ "\n" FD) (princ "yes" FD) ;proceed with plot = yes (princ "\n" FD) )) ;....end of if/progn function list for "if not model tab") ;....end of "for each tab" loop(close FD) ;close the output file - nothing is actually written to the file until this step) ;....end of function definition
0 -
I have actually created a DCL interface for printing... In my application, I have a 3 page form that is in one layout. So i just wrote up the code to print each of the 3 windows... I've presented some of the abbreviated code below. I posted a quick FLASH recording of the program at the following link:http://www.septicad.com/temp/sprint.htmlThe printer and paper names are stored in two text files. I made it easier for people to add printers to the text file with a DCL interface... I will gladly provide you with the LSP and DCL files (can't post zips here)...I posted some code below to show the general LSP framework of the code.Steve MarcottePresidentSeptiCAD.comsepticad@gmail.com
;;;--- Set several variables (setq plotCommand "_plot"); different platforms have different commands... ICAD vs BCAD vs ACAD (setq plotStyle "icad.ctb") (setq plotPrinter "PDF reDirect v2") (setq plotPaper "Letter");;;--- points defining one of the print windows;;;--- points change based on the page # chosen in the DCL menu. (setq p1a (list -0.500000 -0.647059)) (setq p1b (list 8.00000 10.3529))(command "_plot" "Y" "THE-LAYOUT-NAME" plotPrinter plotPaper "I" "P" "N" "W" p1a p1b "" "" "Y" plotStyle "Y" "Y" "N" "N" "N" "N" "Y")
0 -
If you check out the movie, you will notice that there is a problem with truetype kerning (spaces) in 8.2.5 and I have not modified the "very loose" DCL code to make the menus "really pretty"... I am currently using version 8.2.5 for developing purposes, but I tell my clients to purchase BCAD v8 and I provide a download link for 8.1.14.Steve Marcotte
0 -
Thanks Stephen, but I only require a very simple solution compared to yours - I need to generate a script as follows :-
_OpenS:\Drawings\Checking\68124001 check.dwg_qprint_Zoom0.999x_Close_Y_OpenS:\Drawings\Checking\68314001 check.dwg_qprint_Zoom0.999x_Close_Y_OpenS:\Drawings\Checking\69121001 check.dwg_qprint_Zoom0.999x_Quit_Y_QuitAnd it will work for 99% of what we need.As I said the difficult bit is getting the list of files, Anthony's script can generate the SCR file.
0 -
How about using LispEx? example
(DEFUN C:DOIT (/ APP DOC DOCS DWG PATH) (VL-LOAD-COM) (SETQ APP (VLAX-GET-ACAD-OBJECT) DOCS (VLAX-GET-PROPERTY APP 'DOCUMENTS) PATH "C:/TEMP/" ) (FOREACH DWG (VL-DIRECTORY-FILES PATH "*.dwg") (VLAX-INVOKE DOCS 'OPEN (STRCAT PATH DWG) :VLAX-FALSE NIL) (SETQ DOC (VLAX-GET-PROPERTY APP 'ACTIVEDOCUMENT)) (VLAX-INVOKE APP 'ZOOMEXTENTS) (COMMAND "_PLOT" 'YOUR_STUFF_HERE) (VLAX-INVOKE DOC 'CLOSE) ))
0 -
Not being a lisp programmer, I don't fully understand your code Daniel. I have, however, found a simple lisp routine which nearly does what I want - all bar saving the scripts. I can email anyone a copy (bit long to post), but will continue to test/develop this next week. I have 5 people who may be able to use it here, so it is worth a bit of my time!
0 -
Early versions of my attempts posted here :-www.nthong.co.uk/wordpress/
0 -
Roger,I currently have a VB app I wrote to do batch plotting. I use VB dialogs for file selection and print to a specific printer. Using VB Express (which is free) you can create a pretty simple batch plot by sending the commands you listed, and use VB for the file selection.
0 -
This utility was removed in V9?
0 -
This utility was not removed in V9. By default it is installed here: C:\Program Files\Bricsys\Bricscad V9\API\Vba\Samples\batch_plot_tool.dvbIf you don't find it there, chances are that you are using Bricscad Classic: in order to execute .dvb (VBA) files you need the Bricscad Pro version.
0