.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Plotting multi sheet with different media

2 REPLIES 2
Reply
Message 1 of 3
Gdiael
521 Views, 2 Replies

Plotting multi sheet with different media

Hello, everyone.

 

I have a issue with the PlotInfo in the Plotting API

 

In my test drawing there are 10 PaperSpaces, 8 are with A1 size sheet and 2 are A2 size sheet.

The problem is, when a validate the PlotInfo first time (before PlotEngine.BeginDocument), it is in one of A1 PaperSpaces.

As the layout change, I need to validate it again (before PlotEngine.BeginPage).

So in the 9th PaperSpace the Media change, to a Media that has a size close to A2. But when change the Media, i receve a exception.

If I force all PaperSpaces to plot in the same Media, the exception does not happen.

 

My question is, there is a way to change the Media?

Don't make sense to me can change the Layout, and can not change the size, but in the documentation says:

Do not edit the PlotInfo during the plotting.

 

Thanks

Gdiael Barros

2 REPLIES 2
Message 2 of 3
norman.yuan
in reply to: Gdiael

Plotting to multiple sheet (PDF, right?) with Plotservice API can ONLY plot to the same size sheet, as you has discovered.

 

That think the code logic:

 

In the BeginDocument() method, one has to pass in a PlotInfo object that is associate with a layout/PlotSetting, which is a sheet with certain size/media. Then the page(s) plotting starts (multiple pages in a Document). Therfore, all the pages must be in the same size/media.

 

Unless Autodesk modify the API so that the one can pass layout/PlotSetting to BeginPage() method, I am afraid the multiple page plotting would have to be limited to the same sheet size.

 

You have 2 options, which I have used both in my plotting custom apps:

 

1. You plot each layout as single page PDF and use some PDF tools of your choice (iTextSharp, for example) to stitch the PDF files into multiple page PDF files. It is quite simple than you thinks if you have not tried it.

 

2. Use Publish API to drive the PDF plotting. I suspect the Publish API uses the same PDF stitching approach to actually produce the multiple page PDF file.

 

Well, if you do not have to plot to the scale of the layout, then, of course you can resize the layous to different size with you code before the plotting and restore it back after the plottiing, so that all the layouts are in the same size in order for multiple page plottiing to complete.

 

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 3
Gdiael
in reply to: norman.yuan

Thanks for the reply.
I already have an application which works more or less as your first choice.

Actually I was just exploring the API (and sometimes improving my application).
What I do not understand is why we can change the rotation, scale, .ctb (or .stb)

and centralization of each sheet and we can not change the size.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost