SolidWorks Task Scheduler – Part 3
Welcome to part 3 of or blog series covering the SolidWorks task scheduler.
In this section, we will cover the tasks of Convert to High Quality Views, Run Custom Task, Create eDrawings, Update Simulation and the Design Checker.
Convert to High Quality Views:
So why do we want high quality views? Believe it or not, High Quality views make your file sizes much more manageable. Draft Quality views will actually make the file size larger. This is explained in my earlier blog article http://blog.cati.com/2012/10/why-are-some-of-my-drawing-files-so-large.html.
Let's say that you had your SolidWorks setting to create Draft Quality views. All your drawings will be created this way and you may have some very large drawing files. The Task Scheduler is an easy way to convert these all back to High Quality. Converting these is as simple as most of the Task Scheduler tasks. Just select a file or folder and run the task or schedule it for a later time.
Run Custom Task:
You can schedule tasks to run any application, using macros or command-line arguments that you specify.
See SolidWorks API and Add-Ins Help Topics for information about SolidWorks macro files.
Anything that you can run from Windows Start > Run can run as a custom task in SolidWorks Task Scheduler. See the Help files in the application you want to run for information about program command-line arguments and macros in that application.
- Click Run Custom Task on the sidebar, or click Tasks > Run Custom Task.
- In the dialog box, type a new title for the task or leave the default in Task title.
- In Program path, type the path to the program you want to run, or click Browse to locate it.
- If the program requires any program arguments, type them in Program arguments.
SolidWorks Program argument | Program argument definition | Set by default |
/b | Run the SolidWorks software in the background | yes |
/m | Run the SolidWorks macro | yes |
- To run a macro or SolidWorks macro template, type the path in Macro file path, or click Browse to locate it. If you specify a SolidWorks macro template, the token names and their types appear in the Parameter Name and Type columns under Task parameters. In each row that shows a Parameter Name and Type, click in the Parameter String column and type the parameter value.
- If you specify a SolidWorks macro template, create a backup copy of the macro template file before scheduling and running the task, or store the macro template file in a location other than the task working directory. Click View > Options > Task Options to see the task working directory.
Creating a SolidWorks Macro Template
A SolidWorks macro template is a SolidWorks macro that lets you specify parameter values when you schedule it as a custom task in SolidWorks Task Scheduler. A SolidWorks macro template is a text file that typically contains Visual Basic code, SolidWorks API calls, and token names. When you schedule a SolidWorks macro template to run as a custom task in SolidWorks Task Scheduler, you specify the parameter values to substitute for the token names.
Token names can be either text strings or numerics. They are formatted as follows:
Type of Parameter | Format of Token Name |
String | $$$<token_name>$$$ |
Number | ###<token_name>### |
A SolidWorks macro template must have a .swb filename extension.
To create a macro template:
- Open a new text file using Windows Notepad, Microsoft WordPad, or other text editor.
- Copy and paste a SolidWorks macro into the text file.
See SolidWorks API and Add-Ins Help Topics for information about SolidWorks macro files.
- Type token names in place of the parameters whose values you want to specify. For example:
Original code: | swApp.SetCurrentWorkingDirectory "c:\temp" |
Modified code: | swApp.SetCurrentWorkingDirectory $$$TASK_WORKING_DIR$$$ |
- Save the text file with a filename extension .swb.
Create a backup copy of the SolidWorks macro template file before scheduling and running it, or store the SolidWorks macro template file in a location other than the task working directory. Click View > Options > Task Options to see the task working directory. When a task using a SolidWorks macro template runs, the system creates a copy of the macro template and replaces the token names with the parameter values you specified when you scheduled the task. The system saves the file in the task working directory under the same filename as the original SolidWorks macro template. If the original SolidWorks macro template is stored in the task working directory, the system overwrites it with the new file.
See the Task Scheduler help file for a Code example
Create eDrawings
The Task Schedule is a great way to produce eDrawings in quantities.
Simply create an eDrawing task as you would with any other Task Scheduler option.
Once Again, you can select entire folders (with sub directories or individual files)
You Also have the option of what type of files you want to convert (.sldprt, .sldasm,.slddrw)
Update Simulation:
This is one of my favorite tasks. Anyone working with Simulation studies knows that it can take a long time to run some large studies.
Although the Task is described as "Update Simulation", this does not mean that the Simulation Study must have already had been run. You can setup your study and then run the initial run with the task Scheduler.
This is also a great option if you have made a change to a component or any other changed parameters after you have run a study.
Design Checker:
SolidWorks Design Checker verifies design elements such as dimensioning standards, fonts, materials, and sketches to ensure that SolidWorks documents meet pre-defined design criteria. See http://www.solidworks.com/sw/products/3d-cad/cad-standards-checking-and-drawing-comparison.htm for additional information on the Design Checker.
- Click Design Checker on the sidebar, or click Tasks > Run Design Checker.
- In the dialog box, type a title for Task title.
- Click Add Standards and select one or more standards files (*.swstd).
Drafting standards (ANSI, ISO, DIN, JIS, BSI, GOST and GB) are provided with a set of built-in standard files. The file location of the drafting standards is install_dir\dsgnchk\Data.
- Specify files or folders (not both) for Task files or folders.
Option | Description |
Include subfolders | Available when you select folders. |
Add File | Browse with the Open dialog box for SolidWorks files. |
Add Folder | Browse for folders with the Browse for Folder dialog box. Specify part, assembly, drawing, or all types of SolidWorks files for File Name or Type. |
Delete | Select an item in the list and click Delete to remove the item. |
- Select Auto correct all failures to correct all failed checks for which Design Checker supports autocorrection.
We hope this series has given you an insight to how to access the tools in the SolidWorks Task Scheduler. Please check back to the CATI Blog as the Dedicated Support Team will continue posting new series of articles every month that go further into the details of many of the SolidWorks tools. All of these articles will be stored in the category of Daily Dose.....of SolidWorks Support and links to each article with their release date are listed below:
- SolidWorks Task Scheduler - Part1 (Bryan Pawlak 4/2/14)
- SolidWorks Task Scheduler - Part2 (John Van Engen 4/3/14)
- SolidWorks Task Scheduler - Part3 (Blake Cokinis 4/7/14)
- SolidWorks Task Scheduler - Part4 (Neil Bucalo 4/8/14)
No comments:
Post a Comment