.NET

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

Plot to plt file using a system printer

498 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

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

Distinguished Contributor spu
Distinguished Contributor
spu
Posts: 141
Registered: ‎02-21-2007
Message 2 of 3 (491 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 (463 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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!