Если в двух словах, то нужно воспользоваться не AcEditorReactor, а AcPlPlotReactor. Его метод beginDocument() позволяет определить файл, в который идет печать. А если чуть более пространно:
#include "AcPlPlotProgress.h"
#include "AcPlPlotReactor.h"
#include "AcPlPlotReactorMgr.h"
class PlotReactor : public AcPlPlotReactor {
public:
ACRX_DECLARE_MEMBERS(PlotReactor) ;
protected:
//- Auto initialization and release flag.
bool mbAutoInitAndRelease ;
public:
PlotReactor (const bool autoInitAndRelease =true) ;
virtual ~PlotReactor () ;
virtual void Attach () ;
virtual void Detach () ;
virtual AcPlPlotReactorMgr *Subject () const { return (acplPlotReactorMgrPtr ()) ; }
virtual bool IsAttached () const { return (mbAutoInitAndRelease) ; }
virtual void beginDocument(AcPlPlotInfo& plotInfo, const char* pDocname,
long nCopies = 1, bool bPlotToFile = false,
const char* pFilename = NULL);
} ;
//-----------------------------------------------------------------------------
ACRX_CONS_DEFINE_MEMBERS(PlotReactor, AcPlPlotReactor, 1)
//-----------------------------------------------------------------------------
PlotReactor::PlotReactor (const bool autoInitAndRelease) : AcPlPlotReactor (), mbAutoInitAndRelease(autoInitAndRelease) {
if ( autoInitAndRelease ) {
if ( acplPlotReactorMgrPtr () )
acplPlotReactorMgrPtr ()->addReactor (this) ;
else
mbAutoInitAndRelease =false ;
}
}
//-----------------------------------------------------------------------------
PlotReactor::~PlotReactor () {
Detach () ;
}
//-----------------------------------------------------------------------------
void PlotReactor::Attach () {
Detach () ;
if ( !mbAutoInitAndRelease ) {
if ( acplPlotReactorMgrPtr () ) {
acplPlotReactorMgrPtr ()->addReactor (this) ;
mbAutoInitAndRelease =true ;
}
}
}
void PlotReactor::Detach () {
if ( mbAutoInitAndRelease ) {
if ( acplPlotReactorMgrPtr () ) {
acplPlotReactorMgrPtr ()->removeReactor (this) ;
mbAutoInitAndRelease =false ;
}
}
}
void PlotReactor::beginDocument(AcPlPlotInfo& plotInfo, const char* pDocname,
long nCopies, bool bPlotToFile, const char* pFilename)
{
CString msg;
msg.Format("Docname=%s\nisPtotToFile=%s\nFileName=%s", pDocname,
(bPlotToFile ? "Yes":"No"),(bPlotToFile ? pFilename: "<No File>"));
AfxMessageBox(msg);
}
PlotReactor *pReact;
//-----------------------------------------------------------------------------
//----- ObjectARX EntryPoint
class CPlotCheckApp : public AcRxArxApp {
public:
CPlotCheckApp () : AcRxArxApp () {}
virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
AcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt) ;
// TODO: Add your initialization code here
pReact = new PlotReactor();
return (retCode) ;
}
virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) {
if (pReact) delete pReact;
AcRx::AppRetCode retCode =AcRxArxApp::On_kUnloadAppMsg (pkt) ;
return (retCode) ;
}
virtual void RegisterServerComponents () {
}
} ;
//-----------------------------------------------------------------------------
IMPLEMENT_ARX_ENTRYPOINT(CPlotCheckApp)
Надеюсь, что этот код поможет.