.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
DWG to Image
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hello Everybody,
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.
rgds
amit
Solved! Go to Solution.
Re: DWG to Image
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Re: DWG to Image
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hello Alexander.Rivilis,
Thanks for reply, i will work on them, but i am supposed to use COM objects not inside AutoCAD. Any ideas??
Rgds
Amit
Re: DWG to Image
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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.
Re: DWG to Image
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hello Alexander.Rivilis,
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
Regards
Amit
Re: DWG to Image
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hello Alexander,
I tried what you told to me. This is my code below
AcadApplication acadapp = new AcadApplication();
acadapp.Visible = false;
acadapp.Documents.Open(@"D:\Project\Cad Drawings\SHOP\PH#01\05-206.dwg");
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
Best Regards
Amit
Re: DWG to Image
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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:
<quote>
Extension
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.
</quote>
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.
Re: DWG to Image
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
hello norman.yuan,
Thanks for reply and giving suggestion. My program is now working after making suitable changes as you advised.
Thanks for Suggestion.
Best Regards
Amit



