I have a basic question, i am trying to convert an autocad file to image, preferably an bmp, ti, png....etc.
Any body know how to achieve this objective since most of project parts are completed, am stuck up with this issue.
Solved! Go to Solution.
Do I understand correctly that you're going to work with AutoCAD from an external exe-file through ActiveX interface? If so you can use AcadDocument.Export as well as AcadDocument.Plot.PlotToXXX methods.
Thanks for Reply, yes Alexander you are right i am trying to do the same thing. Now i will work on the suggestions given by you. I will get back after some time with results
I tried what you told to me. This is my code below
AcadApplication acadapp = new AcadApplication();
acadapp.Visible = false;
AcadDocument acadDoc = acadapp.ActiveDocument;
AcadSelectionSet sset = default(AcadSelectionSet);
sset = acadDoc.PickfirstSelectionSet;
acadDoc.Export(@"e:\exportFile", "pdf", sset);
But every time i get Invalid Argument error at the export step. Any ideas
Have you ever tried "Export" command in AutoCAD? If you had, you'd have known, PDF cannot be created with "EXPORT" command.
Also, the AcadDocument.Export() method does not export all the types of file the "Export" command does. If you have installed VBA, you can find this in VBA Help about what file type the Export() method can export:
String; input-only This string should contain three characters specifying the type of file to export the drawing into. Case is not important. Use one of the following extensions: .wmf, .sat, .eps, .dsf, or .bmp.
So, if you need to get PDF, you need to do plotting (to plot to DWG To PDF.pc3 or other PDF plotting device) instead of exporting.
Thanks for reply and giving suggestion. My program is now working after making suitable changes as you advised.
Thanks for Suggestion.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.