Batch Plot Title Blocks in model space

Batch Plot Title Blocks in model space

LoganAC34
Advocate Advocate
4,486 Views
22 Replies
Message 1 of 23

Batch Plot Title Blocks in model space

LoganAC34
Advocate
Advocate

I want a LISP that will batch plot selected title blocks in model space. I found THIS post that is similar to what I need but I can't get it to work for me plus there are a few other things I would like to add if possible. 

 

The post linked plots all of the title blocks in the drawing named "A1-" to PDFs which is kind of what I want. Depending on the title block, I need the sheet size and the plot window to change (not just max extents on block). 

 

I want to have the lisp only plots to PDF the selected blocks. I would also like it to work with multiple blocks not just one.  And lastly, I know this is asking a lot but if at all possible, a modular system either in the code or in some kind of options command you can specify block names and their window profile and sheet size to be used for each block. That way other people that see this post can use it for their purposes and for me in the future if anything changes I can update it. I've attached a sample .dwg with the title blocks and examples. Thanks.

0 Likes
Accepted solutions (1)
4,487 Views
22 Replies
Replies (22)
Message 2 of 23

maratovich
Advisor
Advisor

No problem.
You need to use this:

"Revers" - Automatic batch printing a multiple format

 

 

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 3 of 23

LoganAC34
Advocate
Advocate

I'm giving your Revers program a try and I can't get it to work. It doesn't find my title block blocks. Every time I have it search for my title blocks it says "Search is over. Found format -0 ignore duplicates -0"

I have it searching for...

External border is created: Block

Search in blocks: Only with name "Title Block"

Sorting: X-Y (The first column, bottom option)

Where to search: In active document

 

I've also tried multiple different combinations and it still wont find even one.

 

 

0 Likes
Message 4 of 23

maratovich
Advisor
Advisor

You need to configure the search for title blocks.

 

 

 

 

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 5 of 23

LoganAC34
Advocate
Advocate

Ok, after following that video I got it to recognize one. What if the scale of the block changes? There isn't a pattern to the scaling of the block.

0 Likes
Message 6 of 23

maratovich
Advisor
Advisor

No problems.
In the main window (in the middle) there is a field "Scale format" - enter the scale there.
If you increased the title block 100 times, then enter the scale = 100

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 7 of 23

LoganAC34
Advocate
Advocate

I tried that and that doesn't seem like what i mean. The way i found that it works is if i scale one block to 2x the normal block size and i put "2" in that scale format box and then it will only pick up blocks that are 2x the normal size. What i want is it to detect all of my randomly scaled blocks not just ones that are scaled up/down a determined amount. I've attached an example of what i mean. This would be the typical thing i would need to print. Each title block would be its own set of prints. Thanks for your help. 

0 Likes
Message 8 of 23

maratovich
Advisor
Advisor

No problems.
1. Your title block is created by block -
It is necessary to tick the "Block"
2. You change the scale of this block -
It is necessary to tick the "Scale by block"

I'll do a video later.

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 9 of 23

roland.r71
Collaborator
Collaborator

Brrr... You do have a very good reason for doing it this awkward & cumbersome way?

...like: you get these files from a 3rd party and are stuck with this 'garbage'?

 

Realy, if you where sitting next to me and 'design' your drawings like this, I would wack your ears!

 

THIS is what layouts & viewports are made for. (& you wouldn't have any need for exotic functions to plot them)

 

(no offence or anything, just had to get that out my system, so you can disregard this as nothing but my opinion Smiley Tongue )

0 Likes
Message 10 of 23

LoganAC34
Advocate
Advocate

If it were up to me, I would use paper space layouts and view ports. But my company does everything in model space. I am trying to convince them to switch to use paper space. I'm relatively new to the whole field (Approaching 1 year in) and I would need time to figure out exactly how to use it and how we would use it. We have multiple different title blocks and details and I'm not quite sure the best way to organize everything. For me it wouldn't be much of an issue to switch over, but I would also have to teach everyone the "new" way. We also have some older ones have been drafting since manual hand drafting and have taught themselves to use AutoCAD back when it was first starting to be used and getting them to use new things can be hard.

 

But yeah, I totally agree, paper space and view ports would make a couple of things a whole lot easier. But at the moment, I have to deal with doing everything in model space.

0 Likes
Message 11 of 23

maratovich
Advisor
Advisor

1. You need to make blocks right everywhere.
2. Create title blocks with a scale of 1: 1
3. Measure the title blocks and enter into the program template.
4. In the program, note - Scale by block.

For a better solution:
Draw title block size = paper size.
No need to circle in the corner.
Title blocks - on a separate layer.
Make dynamic blocks.
View standard and get a list of scales.
Do not use any scale, but use standard scales.
For builders, this is usually 100: 1, 50: 1, 20: 1

 

roland.r71:
I do not want to discuss the space of paper, but millions of people do not use it, this is not a problem, for many it is convenient.
Do not advise the model or space of paper, it is necessary to give a solution to the problem.

 

 

Screencast will be displayed here after you click Post.

a0d2a04c-1a3e-4cb1-be88-a7f89a69169d

 

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 12 of 23

maratovich
Advisor
Advisor

 

 

 

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 13 of 23

LoganAC34
Advocate
Advocate

My trial expired for the program but I think i got the gist of what it can do. It's definitely is something I will look into and keep in mind as it seems like it can do what I need it to do. One comment I had about the program is I found it a little confusing since there doesn't seem to be too many instructions on how to use it anywhere and some of the text is either messed up or in another language. I don't know if I should mark any response as the solution because the initial request hasn't really met and there are already a number of posts that have this program as the solution. Thanks for your help. I may be back with questions about the program.

0 Likes
Message 14 of 23

maratovich
Advisor
Advisor

Good.
You can write any questions to the developer.
The email address is listed on the site.

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 15 of 23

noogoona
Observer
Observer

I have learned from long experience that paper space is not always right. For example, in the case of a floor plan, when you have to copy and draw repeated elements between plans, it is very inconvenient to copy them while moving to another paper tabs. It is the fastest and most efficient way to complete all the plans in a paper space of one tab while copying them, but in this case, you cannot use batch plot, so a lisp that recognizes the title block and plots is necessary.

0 Likes
Message 16 of 23

maratovich
Advisor
Advisor

@noogoona  написал (-а):

 


And what's the question?

 

 

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 17 of 23

Sea-Haven
Mentor
Mentor

Like Maratovich for the last 10 years or more have been doing auto multiple layout plotting, if you want built in then there is PUBLISH.

Message 18 of 23

hak_vz
Advisor
Advisor

Simple visual lisp code to plot named page setups from model space.

Screencast is here.

 

(defun c:batch_plot_pdf_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)
)

 

 

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 19 of 23

LoganAC34
Advocate
Advocate
Accepted solution

Replying back to my post to share my solution.

 

I found something online that was close to what I needed and then modified it to fit my exact situation - attached is my lisp file. You will need to modify a few bits of code for it to work for your blocks/situation. I tried to mark the lines of code unique to me as best I could. The major lines you need to change to get it to function at all are lines 77, 97 (and following lines if multiple blocks), 103 (to 110 and line 123 if not using page number). I left notes at these areas for what you need to do. 

 

This script allows you to select blocks you want to plot from model space, and it will either plot them to PDF or any custom printer settings you want. There are two commands in this file - BATCHPRINT and BATCHPRINTOPTIONS. As  you probably guessed, BATCHPRINTOPTIONS is settings for the main BATCHPRINT command. 

 

To use the BATCHPRINT command:

  1. Activate the command with BATCHPRINT.
  2. Select the title block(s) you want to print and just hit enter. (Your selection can be one big crossing window over the entire drawing set. The command will filter the selection to just the blocks you listed in the lisp file.)

For the blocks you want to print; the script just gets the extents of the block for the plot window. So basically, in your block, there should probably be a non-plot layer rectangle surrounding the block to make up the print region. Otherwise, the edges of the block are used instead which may only show half of any thickness you have in the lines.

 

The settings in BATCHPRINTOPTIONS are as follows.

  • PDF – Prints to PDF (Default)
    • Paper size
      • 24 x 36 (Default)
      • 11 x 17
      • 8.5 x 11
    • Orientation
      • Landscape (Default)
      • Portrait
    • Scale
      • Fit (Default)
      • Full-Scale (1=25.4 aka: 1" = 25.4mm)

  • Custom – this lets you set whatever options you want with the normal plot settings dialog.

If you set the print options to “Custom”, the next time you use the BATCHPRINT command, it’ll prompt you to set the print settings with the normal plot dialog.

NOTE: Once you set your settings with the plot dialog, DO NOT CLICK “OK”. Instead click “Apply to layout” and then “Cancel”. I know it sounds counter intuitive to click cancel, but that’s because you aren’t actually using that dialog to plot, only to change the settings. If you hit OK, it will do an unintended plot. There is a warning prompt before the print settings dialog as a reminder.

Also note: Using the custom print setting will only ever print to fit and it wont honor any custom scale you set. There is a bug in AutoCAD that doesn’t update the printer settings you can read in a lisp program, so there is no way to retain the value that I know of. 

 

Hopefully I explained everything well enough. If not, let me know if you have any questions.

Message 20 of 23

Sea-Haven
Mentor
Mentor

Like the others if you learn how to use layouts you will never look back, your title blocks are always at true size wether inches or mm, then use a Mview to do just that view your model objects at a scale. You also have more layer control in a viewport in that you can control layers differently in each viewport.

 

The title blocks are not dynamic blocks as per your sample dwg which had "*U2" as block name but rather a block name like 36x24.

 

Like Maratovich and his plot routine it would just work, reading the various title block sizes. I have just done the same thing for one of my clients which has up to 6 different title blocks, can be landscape or portrait.

 

0 Likes