.NET

Reply
Distinguished Contributor
BillZ
Posts: 4,707
Registered: ‎12-12-2003
Message 1 of 3 (518 Views)

plot example in C#

518 Views, 2 Replies
09-19-2005 08:49 AM
R2005:

I am looking for some code examples to plot the active document.
I was hoping to feed a file name during the process to the PDF plotter (I think it's part of the Adobe distiller).
I cannot do this with lisp or Vlisp.

I am trying to write a .dll or command that I can use to plot each layer of a drawing as I loop through them.

I have my console application set up in VS ver.7.1.3088 but am fairly new to C# type of programming.
I have done a few basic programs and tutorals and now need a shove in the right direction to do plotting.

Thanks for any constructive recommendations.

Bill
Distinguished Contributor
BillZ
Posts: 4,707
Registered: ‎12-12-2003
Message 2 of 3 (518 Views)

Re: plot example in C#

09-20-2005 06:11 AM in reply to: BillZ
Am I walking a forbodden path with this question?

Or is there no information that anyone cares to share on this subject?

I did many Google searches on this.

I'm thinking it should be a command method using the Autodesk.AutoCAD.Interop.AcadPlot() and the ApplicationServices.Application.DocumentManager.MdiActiveDocument(); but am not adept enough yet to put it all together.

I'll keep trying.

Bill
Distinguished Contributor
BillZ
Posts: 4,707
Registered: ‎12-12-2003
Message 3 of 3 (518 Views)

Re: plot example in C#

09-21-2005 11:29 AM in reply to: BillZ
Okay,
I think I've made some progress.

I've set doc to the active document and set the plotter configuration to the printer I want to print to.

I still cannot figure out where I access plotting.
Can someone tell me if I have the right resources to plot?
And if so, what part of the model do I access it from?

#region Using directives
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Interop.Common;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.PlottingServices;

#endregion
namespace PlotLayer2PdfFile
{
///
/// Summary description for Class1.
///

public class PDF2FileName
{
[CommandMethod("PlotPDF")]
public void PDF2File()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Autodesk.AutoCAD.PlottingServices.PlotConfigManager.SetCurrentConfig("CutePDF Writer");


//CommandLinePrompts.Message(doc.ToString());

}
///
/// The main entry point for the application.
///

[STAThread]
static void Main(string[] args)
{
//Application.Run(new PDF2FileName());
}
}
}

TIA

Bill
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.