I want to print a dwg file programmatically in my c# project without opening AutoCad.my application is network base and my file is in a shared folder.I do not know how should i do that?
this is abit tricky -
You can use Microsoft's print command, im combination with System.Diagnostics.Process:
The file extenstion DWG belongs to Autocad - hence when Windows will try to use 'print' with this file, it will be printed using AutoCad
Try this one:
using System.Diagnostics;
static void printDWGFile(string f)
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "print";
startInfo.Arguments = f;
Process.Start(startInfo);
}
and call:
printDWGFile("c:/Some-Autocad-File.dwg");
good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With