I'd like to run a batch process on a list of files that gets generated from another application.
Does anyone have any suggestions on how to automate this? I don't want to modify this to a bprc file as the text file changes daily however the name of the text file stays the same.
Thanks
Hi Simon,
the required steps to process a list with DGN files will include:
- locate and open the file with list of DGN files- read each line and open the DGN file- execute the steps required for each DGN
I have created the following VBA example following these steps:
Option Explicit Sub processFiles() Dim sPath As String Dim sListName As String Dim sCurrentFile sCurrentFile = ActiveDesignFile.FullName ' hardcoded path to file with list of DGN: sListName = "D:\DGN\filelist.txt" Open sListName For Input As #1 Do While Not EOF(1) Line Input #1, sPath sPath = Trim(sPath) If Len(Dir(sPath)) > 0 Then ' simple check if file exist process sPath End If Loop OpenDesignFile sCurrentFile, False ' reopen the previous file End Sub ' this subroutine openes a dgn for processing Sub process(sPath As String) Dim oDgn As DesignFile Set oDgn = OpenDesignFile(sPath, False) ' Here the steps to be executed for each DGN file End Sub
This is just one possible approach how this could be done.To improve the performance it might be possible to use the method OpenDesignFileForProgram instead of OpenDesignFile. But this depends on the steps required for each DGN file. Please see the VBA help for details,
I would suggest to post Programming related questions in one of the Programming Communities
I hope this helps?
Best regards,Artur