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
Solved! Go to Solution.
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
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.