.NET

Reply
Valued Contributor
spanqy
Posts: 90
Registered: ‎11-13-2006
Message 1 of 5 (379 Views)
Accepted Solution

Get "Number of copies" value from Plot dialog

379 Views, 4 Replies
05-03-2012 01:14 PM

(I asked this question several years ago and wanted to see if anything has changed, especially since I have moved from VBA to .NET)

 

Is there a way to access the "Number of copies" value as set in the Plot dialog?  I know this value always gets re-set to 1, but I want to know if it is possible to get the value set by the user *after* clicking OK in the Plot dialog.  "Number of Copies" does not seem to be exposed as part of the "Layout" object in .NET (nor was it in VBA).  Is it available anywhere else?  Is this stored in the registry, and if so where is it located?

 

TIA

 

spanqy

 

 

Hi

 

PlotReactorManager reactor’s “BeginDocument” callback should give the number of copies printing. Refer below code.

 

static PlotReactorManager plotReactorMng = null;

 

[CommandMethod("addPlotReactors")]

public void addPlotReactors()

{

    plotReactorMng = new PlotReactorManager();

    plotReactorMng.BeginDocument +=

                new BeginDocumentEventHandler(plotReactorMng_BeginDocument);

}

 

void plotReactorMng_BeginDocument(object sender, BeginDocumentEventArgs e)

{

    Application.ShowAlertDialog(e.Copies.ToString());

}

 

 

[CommandMethod("removePlotReactors")]

public void removePlotReactors()

{

    if (plotReactorMng != null)

    {

        plotReactorMng.BeginDocument -=

                new BeginDocumentEventHandler(plotReactorMng_BeginDocument);

    }

}

 

Thanks

Virupaksha Aithal

Autodesk developer network

ADN Support Specialist
Virupaksha.aithal
Posts: 100
Registered: ‎06-15-2011
Message 2 of 5 (349 Views)

Re: Get "Number of copies" value from Plot dialog

05-17-2012 02:05 AM in reply to: spanqy

Hi

 

PlotReactorManager reactor’s “BeginDocument” callback should give the number of copies printing. Refer below code.

 

static PlotReactorManager plotReactorMng = null;

 

[CommandMethod("addPlotReactors")]

public void addPlotReactors()

{

    plotReactorMng = new PlotReactorManager();

    plotReactorMng.BeginDocument +=

                new BeginDocumentEventHandler(plotReactorMng_BeginDocument);

}

 

void plotReactorMng_BeginDocument(object sender, BeginDocumentEventArgs e)

{

    Application.ShowAlertDialog(e.Copies.ToString());

}

 

 

[CommandMethod("removePlotReactors")]

public void removePlotReactors()

{

    if (plotReactorMng != null)

    {

        plotReactorMng.BeginDocument -=

                new BeginDocumentEventHandler(plotReactorMng_BeginDocument);

    }

}

 

Thanks

Virupaksha Aithal

Autodesk developer network



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

Valued Contributor
spanqy
Posts: 90
Registered: ‎11-13-2006
Message 3 of 5 (338 Views)

Re: Get "Number of copies" value from Plot dialog

05-17-2012 02:06 PM in reply to: spanqy

That works perfectly.  It only took 5 minutes to add it to my existing code.

 

Thanks!

 

New Member
manian.thanu
Posts: 1
Registered: ‎04-18-2013
Message 4 of 5 (221 Views)

Re: Get "Number of copies" value from Plot dialog

04-18-2013 10:57 PM in reply to: spanqy

Hi Guys,

 

I'm not familiar with programming.

 

I don't know how to use the code given by you.

 

Can you help me?

 

Thanks in advance,

Manian M R S

*Expert Elite*
norman.yuan
Posts: 1,017
Registered: ‎04-27-2009
Message 5 of 5 (210 Views)

Re: Get "Number of copies" value from Plot dialog

04-19-2013 06:50 AM in reply to: manian.thanu

manian.thanu wrote:

Hi Guys,

 

I'm not familiar with programming.

 

I don't know how to use the code given by you.

 

Can you help me?

 

Thanks in advance,

Manian M R S


I am afraid that you need someone who knows AutoCAD programming to help you use the said code snippet.

Basically, the code has to be compiled into executable file (DLL file in this case) with some tools, such as Visual Studio. Once the DLL is built, you load inti AutoCAD with NETLOAD command.

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.