plot example in C#

plot example in C#

Anonymous
Not applicable
1,325 Views
2 Replies
Message 1 of 3

plot example in C#

Anonymous
Not applicable
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
0 Likes
1,326 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
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
0 Likes
Message 3 of 3

Anonymous
Not applicable
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
0 Likes