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

DWG to Image

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
amitnkukanur
1190 Views, 7 Replies

DWG to Image

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

Senior Software Engineer
7 REPLIES 7
Message 2 of 8

There are two methods:

1. Plot dwg to image format with AutoCAD Plot API.

2. Using ActiveX AutoCAD Model method Export

Both of them was using more than once in this board. Let use search.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 3 of 8
amitnkukanur
in reply to: amitnkukanur

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

 

Senior Software Engineer
Message 4 of 8

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.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 5 of 8
amitnkukanur
in reply to: amitnkukanur

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

Senior Software Engineer
Message 6 of 8
amitnkukanur
in reply to: amitnkukanur

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 

 

 

Senior Software Engineer
Message 7 of 8
norman.yuan
in reply to: amitnkukanur

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.

Message 8 of 8
amitnkukanur
in reply to: amitnkukanur

Senior Software Engineer

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