.NET

Reply
Member
gcoordinate
Posts: 5
Registered: ‎06-08-2011
Message 1 of 4 (408 Views)

Set Plot Rotation Get Error.

408 Views, 3 Replies
09-12-2012 06:45 AM

I developed with c# based on autocad 2010.

 

My codes do batch plot.

 

If I change plot rotation with "psv.SetPlotRotation(ps, (PlotRotation)i);" at line 67, it give me error like:

Autodesk.AutoCAD.Runtime.Exception: eInvalidPlotInfo
    Autodesk.AutoCAD.Runtime.Interop.Check(Int32 returnValue)
    Autodesk.AutoCAD.PlottingServices.PlotEngine.BeginPage(PlotPageInfo pageInfo, PlotInfo plotInfo, Boolean lastPage, Object parameters)
    zxy.BatchPlot.BatchPlotCommand()
    Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction)
    Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction)
    Autodesk.AutoCAD.Runtime.CommandClass.Invoke(MethodInfo mi, Boolean bLispFunction)
    Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()

 If I use same rotation every plot with "psv.SetPlotRotation(ps, (PlotRotation)0);" at line , it is fine.

 

Attachment contains codes, makefile and compiled dll. It is a rar file. But I have to rename it to txt file for post.

 

Thanks.

Valued Mentor
fieldguy
Posts: 379
Registered: ‎03-31-2005
Message 2 of 4 (391 Views)

Re: Set Plot Rotation Get Error.

09-12-2012 08:42 AM in reply to: gcoordinate

Plotrotation is an enum with 4 values.  It looks like you could use an integer to specify the values as in:

0 = Degrees000

1 = Degrees090

2 = Degrees180

3 = Degrees270

VS2010 does not complain if you use "psv.SetPlotRotation(ps, 0)" so I am going to assume that will work to create a "non rotated" plot.  But, there are only 4 potential values.

 

I don't understand what are you trying to do with "for (int i = 0; i < printcount; ++i)" and then "psv.SetPlotRotation(ps, (PlotRotation)i)".  If your printcount is 20, plotrotation 20 will not work.

 

I have some batch plot routines but all plots are created at the same rotation (PlotRotation.Degrees000).  There are times when we need to change this, but so far that has been accomplished on the print device itself.  

Member
gcoordinate
Posts: 5
Registered: ‎06-08-2011
Message 3 of 4 (347 Views)

Re: Set Plot Rotation Get Error.

09-20-2012 09:50 PM in reply to: gcoordinate

Thanks fieldguy.

 

In my sample code, I set "printcount = 2" just to change the plot rotation.

 

Reality, I will set plot rotation according to paper size.

 

You can try my dll and see the error.

ADN Support Specialist
Balaji_Ram
Posts: 735
Registered: ‎03-21-2011
Message 4 of 4 (305 Views)

Re: Set Plot Rotation Get Error.

10-05-2012 08:46 AM in reply to: gcoordinate

Hello,

 

From the code it appears that you are trying to create a multi-sheet DWF.

I have previously come across a similar issue while creating a multi-sheet PDF and the "eInvalidPlotInfo" exception being thrown. We have a request logged for this behavior with our engineering team.

 

To create a multi-sheet DWF/PDF, the publish API is better suited.

Here is a blog post on this topic :

http://adndevblog.typepad.com/autocad/2012/05/how-to-use-the-autodeskautocadpublishingpublisherpubli...



Balaji
Developer Technical Services
Autodesk Developer Network

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!