Hello
I got a macro to do PDF exports, I slightly modified it to export all the configurations with the same plan. I would like to make two sheets on this plan.
only it exports the leaves independently.
Do you know a way to put both sheets in the same file?
Part of the code concerned:
While i <= iT - 1
'Layout view20
boolstatus = Part.Extension.SelectByID2("Drawing View20", "DRAWINGVIEW", 0.195997909234212, 0.164382166839605, 0, False, 0, Nothing, 0)
Set swView = swSelMgr.GetSelectedObject6(1, 0)
swView.ReferencedConfiguration = vNameConf(i)
'Layout view17
boolstatus = Part.Extension.SelectByID2("Drawing View17", "DRAWINGVIEW", 0.127659480183812, 0.163338832044942, 0, False, 0, Nothing, 0)
Set swView = swSelMgr.GetSelectedObject6(1, 0)
swView.ReferencedConfiguration = vNameConf(i)
'Drawing view16
boolstatus = Part.Extension.SelectByID2("Drawing View16", "DRAWINGVIEW", 6.19293881200676E-02, 0.163338832044942, 0, False, 0, Nothing, 0)
Set swView = swSelMgr.GetSelectedObject6(1, 0)
swView.ReferencedConfiguration = vNameConf(i)
'
Part.ClearSelection2 True
Part.ForceRebuild3 True
For a = 1 TB swModel.GetSheetCount
swModel.ActivateSheet vSheets(a - 1)
Set swSheet = swModel.GetCurrentSheet
' To save the sheet as a PDF
Set swModelDocExt = swModel.Extension
Set swExportPDFData = swApp.GetExportFileData(1)
swExportPDFData.ViewPdfAfterSaving = False
nFileName = Path & "\" & vNameConf(i) & "-" & lastInd & "-" & swSheet.GetName & ".PDF"
boolstatus = swExportPDFData.SetSheets(swExportData_ExportSpecifiedSheets, swSheet.GetName)
boolstatus = swModelDocExt.SaveAs(nFileName, 0, 0, swExportPDFData, lErrors, lWarnings)
Next a
'MsgBox i
i = i + 1
Wend
macro_pdf_enregistrer_sous-2.swp