Plot to file (eNoMatchingMedia error)

Plot to file (eNoMatchingMedia error)

Anonymous
Not applicable
1,049 Views
1 Reply
Message 1 of 2

Plot to file (eNoMatchingMedia error)

Anonymous
Not applicable
Hi!
(AutoCAD 2007, ObjectARX 2007, VS2005)

I'm trying to plot DWG to file.
I choose "DWF6 ePlot.pc3" as device and set plot type to kExtends. And I'm plotting model.
Everythin works fine, but when I try to validate my AcPlPlotInfo object It returns with eNoMatchingMedia error.

When I call getLocaleMediaName() on validator I get A4 media.

Does anybody know why this error occurs, or maybe there are some requirements I have to meet to be able to plot to file?

Best regards,
Aleksander Wons
0 Likes
1,050 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Hi!
I managed to solve this problem.
ObjectARX manula says:

"If a device override is applied, it supercedes the device in the layout and the device in the AcDbPlotSettings overrides object".

Well, it supercedes the device, but only device... Media list remains the same as in AcDbPlotSettings.
So i removed overrideSettings() and now it passes validation.
But afrer reaching sDWG_PlotEngine->beginPage AutoCAD crashes with error:

INTERNAL ERROR: dbplotset.cpp@422: eLockViolation

Here is part of the code (error checkin ommited):

const ACHAR * defaultPlotDeviceName = _T("DWF6 ePlot.pc3");
const ACHAR * defaultPlotDeviceFullPath = NULL;
AcPlPlotInfo *sDWG_pPlotInfo = new AcPlPlotInfo ();
sDWG_pPlotInfo->setLayout (sDWG_LayoutId);
AcPlPlotConfig *sDWG_pPlotConfig = NULL;
es = acplPlotConfigManagerPtr()->setCurrentConfig (sDWG_pPlotConfig, defaultPlotDeviceName);
sDWG_pPlotConfig->setPlotToFile (true);
sDWG_pPlotConfig->refreshMediaNameList ();
sDWG_pPlotInfo->setDeviceOverride (sDWG_pPlotConfig);

AcPlPlotPageInfo *sDWG_pPlotPageInfo = new AcPlPlotPageInfo ();
AcPlPlotInfoValidator *sDWG_pPlotInfoValidator = new AcPlPlotInfoValidator ();

es = sDWG_pPlotInfoValidator->validate (*sDWG_pPlotInfo);
AcPlPlotFactory *sDWG_PlotFactory = new AcPlPlotFactory ();
AcPlPlotEngine *sDWG_PlotEngine;
es = sDWG_PlotFactory->createPublishEngine (sDWG_PlotEngine);
//Plotowanie
//
es = sDWG_PlotEngine->beginPlot (NULL, NULL);
es = sDWG_PlotEngine->beginDocument (*sDWG_pPlotInfo, sDWG_pDocument->fileName(), NULL, 1, true, sourceDWF);
es = sDWG_PlotEngine->beginPage (*sDWG_pPlotPageInfo, *sDWG_pPlotInfo, false, NULL);
es = sDWG_PlotEngine->beginGenerateGraphics ();
sDWG_PlotEngine->endGenerateGraphics ();
sDWG_PlotEngine->endPage ();
sDWG_PlotEngine->endDocument ();
sDWG_PlotEngine->endPlot ();

sDWG_PlotEngine->destroy ();
delete sDWG_pPlotConfig;

What is wrong here??

Best regards,
Aleksander Wons
0 Likes