SOLIDWORKS Task Scheduler – Part 3

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.

SolidWorks

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.

SolidWorks

  1. Click Run Custom Task on the sidebar, or click Tasks > Run Custom Task.
  2. In the dialog box, type a new title for the task or leave the default in Task title.
  3. In Program path, type the path to the program you want to run, or click Browse to locate it.
  4. 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

  1. 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.
  2. 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:

  1. Open a new text file using Windows Notepad, Microsoft WordPad, or other text editor.
  2. Copy and paste a SOLIDWORKS macro into the text file.

    See SOLIDWORKS API and Add-Ins Help Topics for information about SOLIDWORKS macro files.

  3. 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$$$

  1. 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)

SolidWorks

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.

SolidWorks

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/3d-cad/cad-standards-checking-and-drawing-comparison.htm for additional information on the Design Checker.

  1. Click Design Checker on the sidebar, or click Tasks > Run Design Checker.
  2. In the dialog box, type a title for Task title.
  3. 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_dirdsgnchkData.

  4. 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.

  1. Select Auto correct all failures to correct all failed checks for which Design Checker supports autocorrection.

    SolidWorks

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:

  • Share this
Find Your Design Solution in the CATI Store.
Browse Products