• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • AutoCAD 2010/2011/2012 DWG Format

    Reply
    Active Contributor
    M_Mogharabi
    Posts: 26
    Registered: ‎12-12-2011
    Accepted Solution

    How to print dwf file

    941 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...

    Please use plain text.
    *Expert Elite*
    Posts: 6,628
    Registered: ‎06-29-2007

    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
    -------------------------------------------------------------------------
    Please use plain text.
    Active Contributor
    M_Mogharabi
    Posts: 26
    Registered: ‎12-12-2011

    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...

    Please use plain text.
    *Expert Elite*
    Posts: 6,628
    Registered: ‎06-29-2007

    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
    -------------------------------------------------------------------------
    Please use plain text.
    Active Contributor
    M_Mogharabi
    Posts: 26
    Registered: ‎12-12-2011

    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?

    Please use plain text.
    *Expert Elite*
    Posts: 6,628
    Registered: ‎06-29-2007

    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
    -------------------------------------------------------------------------
    Please use plain text.
    Active Contributor
    M_Mogharabi
    Posts: 26
    Registered: ‎12-12-2011

    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?

    Please use plain text.
    *Expert Elite*
    Posts: 6,628
    Registered: ‎06-29-2007

    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
    -------------------------------------------------------------------------
    Please use plain text.