.NET

Reply
Distinguished Contributor spu
Distinguished Contributor
spu
Posts: 141
Registered: ‎02-21-2007
Message 1 of 3 (438 Views)
Accepted Solution

Plot to plt file using a system printer

438 Views, 2 Replies
05-21-2013 05:18 AM

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

Distinguished Contributor spu
Distinguished Contributor
spu
Posts: 141
Registered: ‎02-21-2007
Message 2 of 3 (431 Views)

Re: Plot to plt file using a system printer

05-21-2013 06:03 AM 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

Distinguished Contributor spu
Distinguished Contributor
spu
Posts: 141
Registered: ‎02-21-2007
Message 3 of 3 (403 Views)

Re: Plot to plt file using a system printer

05-21-2013 10:33 PM 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community