Plot API - eInvalidState error code

Plot API - eInvalidState error code

Anonymous
Not applicable
1,700 Views
5 Replies
Message 1 of 6

Plot API - eInvalidState error code

Anonymous
Not applicable

I am using the ObjectARX 2015 Plot API and a PC3/PMP file to plot an A2 size drawing to a Black Ice TIFF printer driver in order to create a TIF image of the drawing.  When the program selects an A2 paper size and attempts to call the pEngine->beginGenerateGraphics() function it returns an eInvalidState error code.  When I select other paper sizes it functions normally.

 

Does anyone have any idea what would cause an eInvalidState error condition?

0 Likes
Accepted solutions (1)
1,701 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

If you use the same plotter and the same media to plot by hand, does that work?

 

Could it be a file size or memory usage issue? An A2 page at high DPI is quite a chunk to handle.

 

What if you add a custom raster file format plotter to output TIFF and add an appropriate custom paper size?

0 Likes
Message 3 of 6

Anonymous
Not applicable

Yes.  If I plot the file manually it works without any problems.  It only fails when I used the ObjectARX Plot API.

 

As far as the memory use we have been plotting A2 size drawings at 300 DPI using the Black Ice TIF printer driver in AutoCAD 2010 for several years and we have not had any problems.  We didn't start having problems until we switched to AutoCAD 2015.  In addition, the A2 paper size is the only one that is causing a problem.  I can plot an A0 size plot without any problems.

 

We can't use the custom raster format provided by AutoCAD because it is limited to 100 DPI.  We need at least 300 DPI for our TIF images.

 

Right now I am just trying to figure out what conditions cause an eInvalidState message.  I have tried contacting the Autodesk Developer Network Help but they didn't provide any help.  I also tried to have them read the PC3/PMP files I am using to plot the drawings to see if anything is wrong with them but apparently, they don't know how to read their own files without using the AutoCAD Plot Manager.

0 Likes
Message 4 of 6

Anonymous
Not applicable

It doesn't make a lot of sense, and if the exact same code works on the same system with the same configuration on an older AutoCAD version, then it sounds like a bug, and having a more obscure part of the API with you and 9 other users in the world doesn't help.

 

Do you have error handling everywhere around the plot system calls? Nothing earlier from plot settings validator? Triple-checked your code and the media names, no recent changes? And did you mean eInvalidEngineState, there's nothing in the SDK about eInvalidState?

0 Likes
Message 5 of 6

Anonymous
Not applicable
Accepted solution

You were right.  The error code was eInvalidEngineState.  As far as the code nothing has changed between the AutoCAD 2010 and 2015 versions other than the compiler and the ObjectARX code.

 

I went back and debugged the code again and found it was erroring off when it was validating the information.  I got a eNoMatchingMedia error message.  I will check it out.

 

Thanks for the suggestions.

 

0 Likes
Message 6 of 6

Anonymous
Not applicable

I finally got back to working on my Plot API problem.  After steping through the code I found it was returning an "eNoMatchingMedia" value from the AcPlPlotInfoValidator::validate function when the AcPlPlotInfoValidator::setMediaMatchingPolicy was set to AcPlPlotInfoValidator::kMatchEnabled.  After that all the other plot api functions failed.  I am not sure why I am getting that message.  I select the plotter I want.  I get the canonicalMediaName list from the plotter so I can select the required paper size.  I set the paper name using the name I retrieved from the media list.  So I don't understand why the media does not match.    I discovered that the plot function will work if I set the media matching policy to kMatchDisabled.  Do you have any idea what the setMediaMatchingPolicy setting does?  The ObjectARX help is a little vague.

0 Likes