User Interface provides a visual way to configure the batch process.
Batch document (*.bpj) can be saved and loaded from the external files.
Batch+ document behaves similar to other file based applications (e.g. office, SOLIDWORKS, etc.). If it has unsaved changes it will be marked with * symbol. Additionally Batch+ has quick access menu in the document title header.
Once the batch process is run it creates job. It is possible to run multiple jobs in parallel in a single session.
- Document title with unsaved mark
- Save document quick access command
- Run job quick access command
Welcome screen is displayed on the start of the application or when there is no opened documents.
- New files creation area
- Open files
- Recent files list. If file cannot be opened (e.g. corrupted or does not exist - it will be automatically removed from the recent files list.) Limit of recent files list is 5 files.
Backstage panel is available when File command is clicked in the ribbon toolbar.
- Return to main screen
- Create new document.
- Open existing document
- Save current document
- Save current document as new file
- Close active document
- Navigate to help web page
- Open About dialog
When creating new document or opening existing one while there is an active document, command will open new window.
Batch document can be configured by accessing he options in the ribbon
User can set the processing scope (files, folders, macros and filters) in this group. Alternatively files, folders and macros can be added to the scope by drag-n-rop directly to corresponding panels.
- Add files to existing scope. Multiple files can be selected. This button will open the file browse dialog
- Add folders to existing scope. Multiple folders can be selected. This button will open the folder browse dialog
- Remove files and folders. Removes the selected files or folders from the scope
- Folder filters. List of filters to use for selecting files from the folder items selected into the scope. You can use a * wildcard, e.g. *.sld* will filter all SOLIDWORKS files (.sldprt, .slddrw and .sldasm) and exclude all other files types. Multiple filters are supported. Click to add new filter. Select and hit Del button to remove filter from the list.
- Add macros. Adds macros to the current macro scope
- Remove macros. Removes selected macros from the current macro scope.
Document settings can be controlled in the settings group.
- Version of SOLIDWORKS to launch for opening files and running macros
- Safe startup options - runs SOLIDWORKS in safe mode bypassing options. If this option is selected none of the add-ins will be loaded to the session of SOLIDWORKS
- Background startup - runs SOLIDWORKS in background. This option only available for SOLIDWORKS Professional or higher
- Silent startup option - runs SOLIDWORKS and with disabled popup messages and splash screen
- Hidden startup option - hides SOLIDWORKS window. This can improve performance however some of the API might not work properly in this mode
- Silent file open option - suppresses all popup dialogs, such as missing references when opening file
- Rapid file open option - open files in a rapid mode:
- For drawings - opens in detailing mode. Some of the APIs might not be available in this mode
- For assemblies - components are loaded lightweight
- For parts - currently not supported and will be ignored
- Invisible mode. Allows to open all files invisibly. This significantly improves the performance however some of the API might not be accessible. Macro need to access arguments to connect to the target document as active model will not be available due to it was opened in invisible mode. Read Model pointer in invisible mode for more information
- Read Only file open option - open files in read-only mode ensuring it cannot be overwritten
- Forbid Files Upgrade - allows to forbid upgrade of the file if it is of a later version than the SOLIDWORKS. SOLIDWORKS is backward compatible, but not forward compatible which means that files cannot be opened in the older version of SOLIDWORKS. This option checks if current session of SOLIDWORKS is newer than the file and rejects saving operation if this is the case. It is recommended to keep this option selected unless it is explicitly required to upgrade files.
- Automatically Save Documents - this option will perform the save of the document after each macro run
- Processing timeout in seconds for processing a single file
- Allows batch process to continue if any of the files failed to process (for example file cannot be opened). If this option is not checked, batch process will be terminated once the error appears.
- Batch size - maximum number of files allowed to process within single session of SOLIDWORKS. Once this maximum is reached Batch+ automatically restarts SOLIDWORKS and continues to process files. This option allows to release resources and improve the performance of batch operations.
Model pointer in invisible mode
Most VBA macros will connect to active SOLIDWORKS model and perform the operation. The code will look like this:
Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2
Set swModel = swApp.ActiveDoc
When invisible mode is selected document is opened hidden thus the ISldWorks::ActiveDoc API will return Nothing as there is no active visible document.
In this case it is required to access the pointer to the model from the arguments passed from Batch+ to the macro.
Dim macroRunner As Object Set macroRunner = CreateObject("CadPlus.MacroRunner.Sw") Dim param As Object Set param = macroRunner.PopParameter(swApp) Dim swModel As SldWorks.ModelDoc2 Set swModel = param.Get("Model")
Jobs can be controlled in the Job group
- Run new job. Multiple jobs can be run per document
- Cancel selected job
Files And Folders
This panel defines list of files and folders to process. Drag-n-drop files and folders directly to the panel or use input group in ribbon to add items with browse dialogs.
Select items and hit Del button to remove them from the scope.
- Path to the macro
- Optional macro arguments
This panel defines list of macros to run on each file. Drag-n-drop macros directly to the panel or use input group in ribbon to add macros with browse dialogs.
Select items and hit Del button to remove macros from the scope.
Specify the arguments in the command line format if macro supports ones. Follow Macro Arguments article of the instructions of how to use macro arguments.
This list contains all jobs which were run or currently running in the active session. Active jobs can be cancelled by pressing the Cancel button.
- Job status (active, completed, failed, cancelled, completed with warnings) is displayed as an icon.
- Progress value
- Number of processed files and total files
- Progress bar of an active job
- Cancel active job
Select job to get more information in the panel below.
Job information displays additional information about job once selected in the jobs panel
Displays overview information about a job, such as start time, duration, total number of files, failed and successfully processed files. For the running job this information is dynamically updated.
Contains detailed breakdown for each file and macro. Icon corresponds to the status of the particular item: successfully processed, failed, processed with warnings, or queued to process.
Each column of the grid can be sorted to quickly identify failed items if needed.
List contains detailed log messages about the progress. Use this log to troubleshoot errors.