TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: terrycadd on June 14, 2007, 06:54:49 PM

Title: PlotDwgs, a plot utility program
Post by: terrycadd on June 14, 2007, 06:54:49 PM
I have recently revised PlotDwgs to be easier to customize by other AutoCAD users and AutoCAD departments. This version utilizes two global lists, which are located at the top of the PlotDwgs.lsp file. The lists are easy to edit, even by a non-programmer. PlotDwgs doesn’t use or require previous page setups, or layout plotter configuration settings. This makes it ideal for batch plotting a folder of customer drawings or other engineering firms’ drawings. In the main dialog, by selecting “Varies” for the paper size, the program determines the correct paper size and corresponding plotter to use for each layout. This version also includes the option of plotting all open drawings.

(http://web2.airmail.net/terrycad/Images/PlotDwgs.gif)

In order to make this version work for most global AutoCAD departments, a few company specific functions were removed, such as a plot stamp function for title blocks, and a Bill of Material utility which updates an Excel spreadsheet for the database. The program may be customized to meet your requirements, such as turning on or off certain layers when plotting. For the International AutoCAD users that use metric page sizes, search and replace A-Size through D-Size with your page size names, and also edit the PaperSize function, and change the values of the Widest~ variables accordingly. PlotDwgs is designed to work with AutoCAD 2000 and up.
Title: Re: PlotDwgs, a plot utility program
Post by: CAB on June 15, 2007, 09:52:50 PM
Terry,
Nice looking routine. I haven't tried it yet but plan to.
Too bad we can't read the PC3 files.
Looking at the code I thought this my be of interest when dealing with Arguments that have the
option if being a list or a single item. It'll save you some code.
Code: [Select]
(defun set_tile_list (KeyName$ ListName@ Selected / Item)
  (start_list KeyName$ 3)
  (mapcar 'add_list ListName@)
  (end_list)
  (foreach Item (if (listp Selected) Selected (list Selected))
    (if (member Item ListName@)
      (set_tile KeyName$ (itoa (- (length ListName@) (length (member Item ListName@)))))
    )
  )
) ; defun set_tile_list
Title: Re: PlotDwgs, a plot utility program
Post by: terrycadd on June 16, 2007, 10:51:14 AM
Hi Cab,
Yes that thread on PC3s was in question when I was working on this. Also thanks to Matt W for his VBA Thing-a-ma-jig contribution which I finally worked out for plotting all open drawings. The win_sort function may be replaced with VVA’s SortStringWithNumberAsNumber function or your version in that thread. I kinda' wanted to use my version here, however. You’ll notice that the second dialog is created on the fly, and the list_box size is determined by how many drawings are in the selected folder to plot. I stopped at 30 lines, because if the dialog gets too large you will get that dialog error message about not able to fit the dialog on screen. 

I will be looking into your suggestions with the set_tile_list function. There seems to be an awkward glitch in the second dialog when the number of drawings in a folder is over 30. When you check the Reverse order box it scrolls to the bottom, which doesn’t look that cool.

Thanks for your input.
Title: Re: PlotDwgs, a plot utility program
Post by: terrycadd on September 17, 2007, 01:25:40 PM
This weekend I revised a few of the functions in PlotDwgs.lsp.  You can download the revised version from AutoLISP Exchange.  It will also be included in Cadalyst for October.
Here is the website again: http://web2.airmail.net/terrycad
Regards,
Terry