Hi,
How should we set printername and paper size using AutoCAD 2008 API. I tried this below code but No Luck. The given printer is not set in the document while print the dwg file.
And Don't know how to set the papersize (A1 or A2 or A3 or A4) using APIs
Any information would be valuable to us a lot. Thanks
Dim objPlot As Autodesk.AutoCAD.Interop.AcadPlot
AcadApp = CreateObject("AutoCAD.Application")
AcadApp.Documents.Open("E:\Projects\Autoprint\Files\9755834A.dwg")
AcadDoc = AcadApp.ActiveDocument
objPlot = AcadDoc.Plot
AcadApp.Preferences.Output.DefaultOutputDevice = "\\BWIRPNTSVR\Samsung ML-2150 Series PCL 6"
AcadApp.Preferences.Output.DefaultPlotStyleTable = "monochrome.ctb"
AcadDoc.ActiveLayout.PlotRotation = Autodesk.AutoCAD.Interop.Common.AcPlotRotation.ac90degrees
AcadDoc.Regen(Autodesk.AutoCAD.Interop.Common.AcRegenType.acActiveViewport)
AcadDoc.ActiveLayout.StandardScale = Autodesk.AutoCAD.Interop.Common.AcPlotScale.acScaleToFit
AcadDoc.ActiveLayout.PlotType = Autodesk.AutoCAD.Interop.Common.AcPlotType.acExtents
AcadDoc.SetVariable("BACKGROUNDPLOT", 0)
AcadApp.ActiveDocument.ActiveLayout.RefreshPlotDeviceInfo()
LeftFooterText = "LHS"
RightFooterText = "RHS"
InsertText(LeftFooterText & "" & RightFooterText)
AcadDoc.ActiveLayout.RefreshPlotDeviceInfo()
objPlot.PlotToDevice() ' To print
AcadApp.ActiveDocument.Close(False)