.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

plot example in C#

2 REPLIES 2
Reply
Message 1 of 3
BillZ
1069 Views, 2 Replies

plot example in C#

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
2 REPLIES 2
Message 2 of 3
BillZ
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
Message 3 of 3
BillZ
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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost