.NET

Reply
Active Contributor
Gdiael
Posts: 26
Registered: ‎06-09-2012
Message 1 of 3 (151 Views)

Plotting multi sheet with different media

151 Views, 2 Replies
02-07-2014 08:17 PM

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

*Expert Elite*
norman.yuan
Posts: 1,049
Registered: ‎04-27-2009
Message 2 of 3 (108 Views)

Re: Plotting multi sheet with different media

02-10-2014 07:43 AM 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.

 

Active Contributor
Gdiael
Posts: 26
Registered: ‎06-09-2012
Message 3 of 3 (94 Views)

Re: Plotting multi sheet with different media

02-10-2014 05:17 PM 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.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!