Print multiple window in model space

Print multiple window in model space

BIM_VIET
Enthusiast Enthusiast
656 Views
3 Replies
Message 1 of 4

Print multiple window in model space

BIM_VIET
Enthusiast
Enthusiast

Hi all,

At model space, I would like to print out to pdf the multiple drawing as the photo below, and merge to one file pdf after finish. The points of windows is diagonal blue line.

1. I try follow instruction by Kean : https://www.keanw.com/2007/10/plotting-a-wind.html

But just only made 1 pdf per time. If I put it into loop but error at CreatePublishEngine().or pe.BeginPlot(ppd, null);

2. Any ideal to merge all into 1 pdf after finish.

 

BIM_VIET_0-1671684692386.png

 

 

0 Likes
Accepted solutions (2)
657 Views
3 Replies
Replies (3)
Message 2 of 4

Ed__Jobe
Mentor
Mentor
Accepted solution

As @norman.yuan noted in the other thread you replied to, the solution is to use a 3rd party pdf library to combine the sheets into one pdf after they are printed. Otherwise you can just use sheetset manager, but it requires actual sheets to print, not just rectangles in model space. All you would have to do is create a sheet and a single viewport for each plot area.

Ed


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.
How to post your code.

EESignature

0 Likes
Message 3 of 4

norman.yuan
Mentor
Mentor
Accepted solution

I agree with @Ed__Jobe : if possible, you should present these contents in ModelSpace in mutiple Layouts, so that any CAD user can easily print them with "Publish" command. No need to re-invent the wheel (for such a regular Acad operation). It is also very easy to use Publish API (which you have already found) to print them, as if it is done manually.

 

It is certainly doable entirely by code, using either PlotEngine, or Publish API. But in your case (assume all the rectangle area are in the same size), it might be easier to code by:

 

1. identify the rectangle size (height, width, center) and the quantity of the rectangles

2. create a layer for each rectangle and open a viewport to present the rectangle in proper scale

3. SAVE THE DRAWING (it is required before you can run Publish API code to print these layout

4. Write code to use Publish API to print. You can (and have already) find plenty of code samples of this.

 

The good outcome of this is that now you have the layouts created to present these rectangles, and they can easily be printed/published later by any CAD user.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 4 of 4

maratovich
Advisor
Advisor

No problem, use this - Revers 
In the program, click "Publish to PDF", a multi-sheet one file will be created.

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