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

Plot to plt file using a system printer

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
spu
Advocate
983 Views, 2 Replies

Plot to plt file using a system printer

Hi,

 

In our drawings we have a layout with a view port and tittle block.

Default printer set for that layout is "dwg to pdf.pc3" and paper is "ISO A3".

 

I had to plot this layout [extence] to a plt file for the use of our Production ERP.

We had to print to a specific windows printer with paper size A3.

We use to do it in VBA with the bellow code.

How to do it in .Net

--------------------------------------------------------------------

Public Function BetsyPlot2() As Boolean


    Dim Plot As AcadPlot
    Dim alayout As AcadLayout
    Dim lowerLeft(0 To 1) As Double
    Dim upperRight(0 To 1) As Double
    Dim retval As Boolean
    retval = flase



    For Each alayout In ThisDrawing.layouts
        If alayout.Name = "Betsy" Then
            RedrawViewPort
            ThisDrawing.ActiveLayout = alayout
            ThisDrawing.SetVariable "ANNOALLVISIBLE", 1
            lowerLeft(0) = 0
            lowerLeft(1) = 0

            upperRight(0) = 400
            upperRight(1) = 275

            alayout.SetWindowToPlot lowerLeft, upperRight
            alayout.PlotType = acWindow
            'alayout.UseStandardScale = True
            alayout.StandardScale = acScaleToFit
            'ThisDrawing.ActiveLayout.PlotRotation = ac270degrees
            alayout.ShowPlotStyles = False    'if it is true this may cause the layout become black & wite
            ' MsgBox ("sss")
            Set Plot = alayout.Document.Plot

            ' Plot.DisplayPlotPreview acPartialPreview
            ThisDrawing.SetVariable "BACKGROUNDPLOT", 0
            Call CreateDirectory(Trim(Me.txtFileNo.Text), BasePath)
            retval = Plot.PlotToFile(BasePath & Me.txtFileNo.Text & "\" & Me.txtDwgNo.Text & ".plt", comboPlotPrinter.Text)
            BetsyPlot2 = retval
            Exit Function
        End If
    Next alayout
    MsgBox ("Betsy layout not found in the drawing!")
    BetsyPlot2 = retval
End Function

--------------------------------------------------------------------------------------------------------------------------------------------------

Regards,

Shijith

Tags (1)
2 REPLIES 2
Message 2 of 3
spu
Advocate
in reply to: spu

Hi,

 

Please advice how to plot a layout to a printer & its paper size which is not part of the layout page setup.

All example uses "dwg to pdf.pc3" but in my cas i had to use a system printer.

 

I just want to print to a system printer with default specification in the printer itself.

Please help.

 

Regards,

Shijith

Message 3 of 3
spu
Advocate
in reply to: spu

Hi,

I solved my issue by creating a pc3 file for the printer and passing null to media.
Is there no aother way to specify a network or system printer.
Please advice.

Regards,
Shijith

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