AutoCAD 2010/2011/2012

AutoCAD 2010/2011/2012

Reply
Active Contributor
M_Mogharabi
Posts: 26
Registered: ‎12-12-2011
Message 1 of 8 (2,109 Views)
Accepted Solution

How to print dwf file

2109 Views, 7 Replies
12-18-2011 02:04 AM

Hi,

I want to print an existing dwf file to printer in a network programmatically with c# code. I tried acdbmgd.dll and acmgd.dll but i did not know which class and method should i use.

please help me...

Hi,

 

>> Is there any way to print DWG file directly with c# code??

Yes, there exists a lot of code around the world, e.g. >>>this from Kean Walmsley<<<

 

- alfred -

Hi,

 

look to the PC3-files you have plus the paper-sizes defined for each plotter. You can therefor start AutoCAD, open the _PLOT-dialog and there you have the info what is configured on your machine and so what's ready for use.

 

- alfred -

*Expert Elite*
Alfred.NESWADBA
Posts: 9,583
Registered: ‎06-29-2007
Message 2 of 8 (2,093 Views)

Re: How to print dwf file

12-18-2011 01:18 PM in reply to: M_Mogharabi

Hi,,

 

if you really mean DWF (and not DWG) then you should look either in the >>>forum for DesignReview<<< or, if the DWF is loadable in your Internet Explorer then you should look into the IE-lib for printing.

The acdbmgd.dll and acmgd.dll are AutoCAD-libs and are not used to print a DWF as long as you don't want to insert it into an AutoCAD-drawing and do a plot then from AutoCAD (what's a long way round).

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Active Contributor
M_Mogharabi
Posts: 26
Registered: ‎12-12-2011
Message 3 of 8 (2,084 Views)

Re: How to print dwf file

12-18-2011 09:24 PM in reply to: Alfred.NESWADBA

Thanks alfred, first I have searched a week to find a way to print DWG file but i did not find anything and just i found some applications to convert DWG to DWF. so i thought that i should convert my DWG file to DWF and then print the DWF file.

Is there any way to print DWG file directly with c# code??

Please help me...

*Expert Elite*
Alfred.NESWADBA
Posts: 9,583
Registered: ‎06-29-2007
Message 4 of 8 (2,078 Views)

Re: How to print dwf file

12-19-2011 12:08 AM in reply to: M_Mogharabi

Hi,

 

>> Is there any way to print DWG file directly with c# code??

Yes, there exists a lot of code around the world, e.g. >>>this from Kean Walmsley<<<

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Active Contributor
M_Mogharabi
Posts: 26
Registered: ‎12-12-2011
Message 5 of 8 (2,075 Views)

Re: How to print dwf file

12-19-2011 02:10 AM in reply to: Alfred.NESWADBA

Thanks alot. however that code is for DWF files(not DWG files), so i should convert my DWG file to DWF before start to plotting it, am i right?

*Expert Elite*
Alfred.NESWADBA
Posts: 9,583
Registered: ‎06-29-2007
Message 6 of 8 (2,070 Views)

Re: How to print dwf file

12-19-2011 02:38 AM in reply to: M_Mogharabi

Hi,

 

>> however that code is for DWF files(not DWG files)

No, not in the way you mean. The code shows how AutoCAD has to be used for plotting via C# (plot a DWG).

And that you think it's for DWF (because in the code the word "DWF" appears) ==>the code's result is a "plotted DWF-file", but you can change the code to plot to any other plotter, just set it to your plotter- (and page-) -properties.

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Active Contributor
M_Mogharabi
Posts: 26
Registered: ‎12-12-2011
Message 7 of 8 (2,050 Views)

Re: How to print dwf file

12-19-2011 08:49 PM in reply to: Alfred.NESWADBA

ahaa... Thanks alot again. now i am got it. excuse me for my beginner questions, but it is the last one :

 

How can i change the plotter from file to printer? How should i change the string parameter of "SetPlotConfigurationName" method  to send my DWG file to printer?

*Expert Elite*
Alfred.NESWADBA
Posts: 9,583
Registered: ‎06-29-2007
Message 8 of 8 (2,044 Views)

Re: How to print dwf file

12-19-2011 11:16 PM in reply to: M_Mogharabi

Hi,

 

look to the PC3-files you have plus the paper-sizes defined for each plotter. You can therefor start AutoCAD, open the _PLOT-dialog and there you have the info what is configured on your machine and so what's ready for use.

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.