1 Reply Latest reply on Feb 17, 2012 6:15 AM by strangd

    PADS macro in batch mode

    martin.gyurko

      Dear PADS users,

       

      I wrote a nice macro which automatically generates a DXF file from a batch file. Is it possible to pass arguments from the batch into the macro?

      It would be nice to pass the filename into the macro. Any other ideas???

       

      best regards,

       

      Wolfgang

       

       

          Application.ExportDocument("DxfExport.dxf")

          DXFExportDlg.RemoveAll.Click()

          DXFExportDlg.AvailableLayers.Selected(1) = true

          DXFExportDlg.AvailableLayers.Selected(4) = true

          DXFExportDlg.AvailableLayers.Selected(27) = true

          DXFExportDlg.AvailableLayers.Selected(30) = true

       

          DXFExportDlg.Add.Click()

          DXFExportDlg.DXFFileUnits = "Inches"

          DXFExportDlg.Copper = false

          DXFExportDlg.Text = false

          DXFExportDlg.CopperPour = false

          DXFExportDlg.Routes = false

          DXFExportDlg.Attributes = false

          DXFExportDlg.Ok.Click()

        • 1. Re: PADS macro in batch mode
          strangd

          Use the SET statement in your batch file.  This will setup a variable in your Windows environment. Call the VB program from the batch file and have it read in the new environmental variable that you just made.

           

          dir/b "%CURRENT_PROJECT_PATH%\*.prj" >C:\wdir\BOM\BOM_1.txt

          FOR /F "eol=c tokens=1,6* delims= " %%i IN (C:\WDIR\BOM\BOM_1.txt) DO set BOM_Proj=%CURRENT_PROJECT_PATH%\%%i

          FOR /F "eol=c tokens=1,6* delims= " %%r IN (C:\WDIR\BOM\BOM_1.txt) DO CALL %SDD_HOME%\wv\win32\bin\icdbPartsLister.exe -d "%CURRENT_PROJECT_PATH%\%%r" -i "C:\wdir\BOM\Partlister_ZIN.ipl" -b "%WBLOCK%" -o "C:\wdir\BOM\%WBLOCK%.lst"

          set BOM_TXT=%WBLOCK%.lst

          set BOM_DIR=%CURRENT_PROJECT_PATH%

          set

          del C:\WDIR\BOM\BOM_1.txt

          CALL "C:\Program Files\Microsoft Office\OFFICE12\Excel.exe" "C:\wdir\BOM\ZIN_bom_seed.xls"

          del C:\wdir\BOM\%WBLOCK%.lst

          exit