<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Publish or print files automatically every month in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11074702#M2601</link>
    <description>&lt;P&gt;Thank you so much &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14801"&gt;@Ed__Jobe&lt;/a&gt;&amp;nbsp; it finaly work! &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I forgotten a " after run&lt;/P&gt;</description>
    <pubDate>Thu, 31 Mar 2022 18:35:42 GMT</pubDate>
    <dc:creator>joh.richard</dc:creator>
    <dc:date>2022-03-31T18:35:42Z</dc:date>
    <item>
      <title>Publish or print files automatically every month</title>
      <link>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11027033#M2593</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Hello, I have ~400 files that I want to automatically convert to PDF every month.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN&gt;I currently create a .DSD file to run a publish.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN&gt;I would like printing to be automatic every 1st of the month at 2am.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN&gt;I tried the automatic publish&amp;nbsp; in the options,&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN&gt;but it did not meet my needs.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN&gt;Has anyone done something similar before?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 17:48:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11027033#M2593</guid>
      <dc:creator>joh.richard</dc:creator>
      <dc:date>2022-03-24T17:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Publish or print files automatically every month</title>
      <link>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11027053#M2594</link>
      <description>&lt;P&gt;You might try the Windows Task Scheduler (type it in the Cortana search bar). You can create a script that does what you want in AutoCAD or even ScriptPro and then use AutoCAD's command line switch /b to run the script. Then create a task in task scheduler to run it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, if you have Bluebeam, you can create a batch job file and run that in Task Scheduler.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 18:01:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11027053#M2594</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-03-24T18:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Publish or print files automatically every month</title>
      <link>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11028828#M2595</link>
      <description>&lt;P&gt;Maybe you will like this -&amp;nbsp;&lt;A href="https://www.kdmsoft.net/revers.html" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Revers&lt;/STRONG&gt;&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;You can specify a folder with your files and start automatic printing.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 14:21:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11028828#M2595</guid>
      <dc:creator>maratovich</dc:creator>
      <dc:date>2022-03-25T14:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Publish or print files automatically every month</title>
      <link>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11029166#M2596</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1622231"&gt;@maratovich&lt;/a&gt; That program doesn't appear to support scheduling of batch jobs. He doesn't want to come in a 2 am to start the batch.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 16:39:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11029166#M2596</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-03-25T16:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Publish or print files automatically every month</title>
      <link>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11065694#M2597</link>
      <description>Thank you very much for your suggestions. I will test your suggestions and get back to you with what works best.</description>
      <pubDate>Mon, 28 Mar 2022 13:28:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11065694#M2597</guid>
      <dc:creator>joh.richard</dc:creator>
      <dc:date>2022-03-28T13:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Publish or print files automatically every month</title>
      <link>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11071304#M2598</link>
      <description>&lt;P&gt;The script and Script pro work well. But I don't know how to link them in task scheduler. I add a task. The task launches and asks which application it should open &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 14:42:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11071304#M2598</guid>
      <dc:creator>joh.richard</dc:creator>
      <dc:date>2022-03-30T14:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Publish or print files automatically every month</title>
      <link>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11071385#M2599</link>
      <description>&lt;P&gt;When it says to choose, the words are "program/script". Use the second option. Create a DOS *.bat file using Notepad. ScriptPro's Help gives you a sample script and sample bat command.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Command Line Access

To run a series of ScriptPro 2.0 projects from a DOS batch file,
you can use the ScriptPro command line interface:

&amp;lt;install dir&amp;gt;\ScriptPro &amp;lt;project name&amp;gt; "run"

For example:

C:\\ScriptPro 2.0\\ScriptPro.exe "c:\\TestProject.bpl" "run"

You can also use "exit" at the end to exit ScriptPro silently after 
processing the drawing list.

For example:

C:\\ScriptPro 2.0\\ScriptPro.exe "c:\\TestProject.bpl" "run" "exit"
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 30 Mar 2022 15:09:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11071385#M2599</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-03-30T15:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Publish or print files automatically every month</title>
      <link>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11071422#M2600</link>
      <description>&lt;P&gt;I have a part of code in VBA for printing files in PDF&lt;/P&gt;&lt;P&gt;I would add a line to acaddoc.lsp to run this routine each time a specific file is opened.&lt;/P&gt;&lt;P&gt;I would add this specific drawing to task scheduler&lt;/P&gt;&lt;P&gt;It works almost perfectly. The drawings are printed, but not taking into account the printing specifications (size, CTB, rotation)&lt;BR /&gt;Could someone check my code and see where my error is? I guess it plotConfig the problem&lt;BR /&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Public Sub DoPdfPlot()
    Dim backPlot As Integer
    Dim fileNames() As String
    Dim oPath As String
    Dim dPath As String
    Dim plotter As String
 
    'Setting background plot variable
    backPlot = ThisDrawing.GetVariable("BACKGROUNDPLOT")
    ThisDrawing.SetVariable "BACKGROUNDPLOT", 0
    
    
    'Original path -&amp;gt; Where DWG are
    oPath = "C:\Temp\architecture\"
    'Destination path -&amp;gt; Where PDF go
    dPath = "C:\Temp\architecture\pdf\"
    
    fileNames = GetFileNames(oPath)
    Dim fName As String

    Dim pdfName As String
    Dim dwg As AcadDocument
    Dim i As Integer
    For i = 0 To UBound(fileNames)
        fName = fileNames(i)
        
        Dim splitedFileName() As String
        Dim brutName As String
        
        ''Name de PDF "[DWGName].pdf"
        splitedFileName = Split(fName, ".")
        brutName = splitedFileName(0)
        
        pdfName = dPath &amp;amp; brutName &amp;amp; ".pdf" ''Determine PDF name based on DWG file name
        Set dwg = AcadApplication.Documents.Open(fName)
        PlotToPdf dwg, pdfName
        dwg.Close False
    Next
    ThisDrawing.SetVariable "BACKGROUNDPLOT", backPlot
End Sub

Private Function GetFileNames(path As String) As String()
    
    Dim fileNames() As String
    Dim i As Integer
    Dim file As String
    ''Get all DWG file from the Original Path
    file = Dir(path &amp;amp; "*.dwg")

    While file &amp;lt;&amp;gt; ""
        ReDim Preserve fileNames(i)
        fileNames(i) = file
        i = i + 1
        file = Dir
    Wend

    GetFileNames = fileNames
End Function

Private Sub PlotToPdf(dwg As AcadDocument, pdfFile As String)

    
    Dim ptObj As AcadPlot
    Dim ptConfigs As AcadPlotConfigurations
    Dim plotConfig As AcadPlotConfiguration
    Dim canonicalName As String
    
    'Create a new plot configuration with all needed parameters
    Set ptObj = dwg.Plot
    Set ptConfigs = dwg.PlotConfigurations

    'Add a new plot configuration
    Set plotConfig = ptConfigs.Add("PDF", True)
    
    plotConfig.ConfigName = "AutoCAD PDF (Web and Mobile).pc3"
    plotConfig.UseStandardScale = False
    plotConfig.StandardScale = acScaleToFit
    plotConfig.PlotRotation = ac0degrees
    plotConfig.PlotType = acExtents
    plotConfig.CanonicalMediaName = "UserDefinedImperial (48.00 x 36.00Inches)"
    plotConfig.CenterPlot = True
    plotConfig.StyleSheet = "C:\Users\KI-0052-SI\AppData\Roaming\Autodesk\AutoCAD 2021\R24.0\enu\Plotters\Plot Styles\Acad.ctb"
    plotConfig.PlotWithPlotStyles = True


    'Updates the plot
    plotConfig.RefreshPlotDeviceInfo
    
    
    Dim success As Boolean
    success = ptObj.PlotToFile(pdfFile, plotConfig.ConfigName)

End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 15:19:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11071422#M2600</guid>
      <dc:creator>joh.richard</dc:creator>
      <dc:date>2022-03-30T15:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Publish or print files automatically every month</title>
      <link>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11074702#M2601</link>
      <description>&lt;P&gt;Thank you so much &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14801"&gt;@Ed__Jobe&lt;/a&gt;&amp;nbsp; it finaly work! &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I forgotten a " after run&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 18:35:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/publish-or-print-files-automatically-every-month/m-p/11074702#M2601</guid>
      <dc:creator>joh.richard</dc:creator>
      <dc:date>2022-03-31T18:35:42Z</dc:date>
    </item>
  </channel>
</rss>

