Automated Batch plot based attribute in drawing title block (e.g. Size: C)

Automated Batch plot based attribute in drawing title block (e.g. Size: C)

johntpope
Participant Participant
1,277 Views
11 Replies
Message 1 of 12

Automated Batch plot based attribute in drawing title block (e.g. Size: C)

johntpope
Participant
Participant

We are doing a large project (~900 files) that has many drawing sizes. We want to batch plot them using the attribute in the title block (e.g. "DWG Size: C") to choose the "Page Setup"

 

We can of course segregate the files by drawing size (in folders, modify filenames, etc...).  However, we are interested in achieving this without knowing the specified size before hand, rather specifying this attribute that then determines the page setup to choose ... automate it, not engineer around it.

0 Likes
Accepted solutions (1)
1,278 Views
11 Replies
Replies (11)
Message 2 of 12

paullimapa
Mentor
Mentor

Lisp routine would select the title block then locate the attribute based on its tag and finally retrieve the value. Then condition statements to determine based on that value the name of the page setup to use assuming that page setup name can be found in the drawing. Perhaps post a dwg with this sample title block and attribute and list the matching pagesetup names to use 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 3 of 12

chriscowgill7373
Advisor
Advisor

Unfortunately, I do not believe that PUBLISH has the ability to do what you are asking.  It expects all of that information to be input ahead of time.  Also you cant run scripts as part of the publish process, so there wouldnt be a way to do this in the background.   

Perhaps an adjustment to your workflow for future projects may be helpful. When adding your title block, you can set the correct page setup current, then when you run the publish, it will use that specified page setup and eliminate the need for an "addon".

As for your current question, some sort of script that opens all the selected drawings, sets the pagesetup current, then plots and closes would probably serve you best.  If you put a save in there, in theory, you could move into just using the last saved page setup, and I would think that it would be much faster to just issue the PUBLISH command than to run the script every time.

What about looking at the title block name itself instead of adding an extra attribute?  If you can just look for the block name it would be faster than looking for the block name, then looking through all the attributes until you find the one you need, and hope someone filled it out like they should.   Same thing as what Paul suggests, you would also need to assume the page setup existed in the file.   In the past, when I've done automating of page sizes, I started my LISP with importing the named pagesetups from our template and overwriting whatever was there.  Then chose the page size based on the name of the title block. 

 

 

 


Christopher T. Cowgill, P.E.

AutoCAD Certified Professional
Civil 3D Certified Professional
Civil 3D 2024 on Windows 10

Please select the Accept as Solution button if my post solves your issue or answers your question.

Message 4 of 12

johntpope
Participant
Participant

Many thanks Chris and Paul.

I am attaching example of sanitized DWG file with the Title Block with C-size.  In this case we would want it to print using page setup for "ANSI Full Bleed 22x17 in".

0 Likes
Message 5 of 12

paullimapa
Mentor
Mentor

you may get better feedback by posting in the customizable forum here:

Visual LISP, AutoLISP, General Customization Forum Autodesk


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 6 of 12

paullimapa
Mentor
Mentor

In your posting you'll need to provide the following details:

Page Setup Name:

Block Name:

Attribute Tag Name:

Currently my best guess is this block but no idea which tag:

paullimapa_0-1713045513691.png

And which page setup name:

paullimapa_1-1713045554454.png

 

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 7 of 12

johntpope
Participant
Participant

Thank Paul 

In this case, the Block Title actually contains the DWG size information (i.e. "Full D Land") ... its not in one of the Tag IDs in the block. 

This Page Setup would be "PDF-DL-NU"

Likewise, DWGs with Block "Full C Land" would be "PDF-CL-NU"

0 Likes
Message 8 of 12

chriscowgill7373
Advisor
Advisor

It can be done.  I don't have the knowledge on how to make it a script you run on a folder of drawings.

My Plot program is a little too customized for my current workflow.  It would probably take a few hours to reverse it down to something that would work specifically for you.

There are two parts to the LISP.  Part 1 looks at the title block and sets variables for the pagesetup, file type, and folder to place the file.  The second portion issues the -plot command and feeds those values to it.


Christopher T. Cowgill, P.E.

AutoCAD Certified Professional
Civil 3D Certified Professional
Civil 3D 2024 on Windows 10

Please select the Accept as Solution button if my post solves your issue or answers your question.

Message 9 of 12

baksconstructor
Advocate
Advocate

Why don't you use a ready-made solution?
There are programs that automatically detect the format in your drawing. Moreover, they can find texts in the title block and sort them.
There are a lot of Lisps on this topic on the forum, use the search
There are also commercial ones, for example such as - Revers 

Message 10 of 12

paullimapa
Mentor
Mentor
Accepted solution

As I stated in a prior post you'll get more feedback by posting this subject in the customization forum.

But here's my take at this with the attached lisp code DwgACCBlkPlotPS.lsp.

Save the code into a folder where it can be loaded (drag & drop) into AutoCAD in an empty drawing.

When DwgACCBlkPlotPS runs it will request for the drawing folder location.

All the drawings (currently not opened) in this location will be examined using the ODBX method which does NOT require the drawing to be opened.

When a drawing's layout contains the specified Title Block ("FULL D Land") and the corresponding Pagesetup name ("PDF-DL-NU") is found in the drawing then a Script with a sequence of Plot commands are automatically generated. The script file is named per drawing name with the layout name appended ie:

Example - Copy 1.dwg with layout named: REV XX Additions = Script file: Example - Copy 1-REV XX Additions.scr

After examining each drawing a batch file (DwgACCBlkPlotPS.cmd) is run using the Coreconsole method to execute the Plot Script files which again does NOT require AutoCAD to open any drawings.

Also Windows Explorer is launched with that specified folder opened for review after the entire Plot sequence completes.

If you need to add/modify the Title Block and the associated Pagesetup names, change the code at this location (but preserve the same formatting):

 

(cons (strcase "FULL C Land") (strcase "PDF-CL-NU"))
(cons (strcase "FULL D Land") (strcase "PDF-DL-NU"))

 

Let me know how this works out for you.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 11 of 12

johntpope
Participant
Participant

Paul, I wanted to let you know that the code works exactly as you described and is very helpful! I've already started adding other PageSetUps and looking to customize it further. Again, greatly appreciated!

John

0 Likes
Message 12 of 12

paullimapa
Mentor
Mentor

glad that worked out for you...cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes