Dim AutoCAD As New AcadApplication
Dim thisdrawing As AcadDocument
AutoCAD.Visible = False
Dim Print1 As String 'Variable identifiant le nom de l'imprimante
Print1 = "DWG To PDF.pc3"
thisdrawing = AutoCAD.Documents.Open(fichier_autocad, False, True)
ThisDrawing.ActiveLayout.ConfigName = Print1
thisdrawing.ActiveLayout.StyleSheet = "Alfalaval.ctb"
thisdrawing.ActiveLayout.PaperUnits = _ Autodesk.AutoCAD.Interop.Common.AcPlotPaperUnits.acMillimeters
thisdrawing.ActiveLayout.StandardScale = _ Autodesk.AutoCAD.Interop.Common.AcPlotScale.acScaleToFit
ThisDrawing.ActiveLayout.CenterPlot = True
thisdrawing.ActiveLayout.PlotType = _ Autodesk.AutoCAD.Interop.Common.AcPlotType.acExtents
ThisDrawing.ActiveLayout.RefreshPlotDeviceInfo()
thisdrawing.SetVariable("BACKGROUNDPLOT", 0) ' thisdrawing.Plot.PlotToDevice(Print1)
thisdrawing.SetVariable("BACKGROUNDPLOT", 2)
ThisDrawing.ActiveLayout.RefreshPlotDeviceInfo()
thisdrawing.Save() 'je sauvegarde avant de quitter pour ne pas avoir le message "voulez-vous enregistrez avant de quitter ?'
AutoCAD.Quit() Ca fonctionne chez moi et m'enregistre dans le répertoire courant du fichier