Control DriveWorks Model Generation Order

Article by Isaac Smith on Aug 26, 2024

When running the Release Models task in a Specification Flow, all rules associated with the Model Rules and Generation Tasks are evaluated; the models to be generated are placed in a queue. The generation is completed either through the DriveWorks Pro add-in inside of SOLIDWORKS or by DriveWorks Autopilot. Both methods read the model generation queue, and the DriveWorks add-in inside SOLIDWORKS allows users to select which top-level model they wish to generate. Autopilot will simply pick the next model in the list.

Introducing Tags

Tags are one way to control the DriveWorks generation queue. Tags can assign priority to certain models, specifications, emails, etc., to make sure Autopilot processes them first, before moving on to other models.  

For example, if tags are set in Autopilot like those shown below (using the Edit Tags dialog), then all models with the Primary tag that exist in the generation queue will be generated first. Then all models with the Secondary tag will be generated next, and all other models without a tag (or other non-specified tags) will be generated later.

DriveWorks Autopilot Edit Tags

Tags can be set in Model Rules using the Tags rule:

Set Tags in DriveWorks

Important Note: Tags are considered independent of the specification the models were released from. What does this mean? Let’s walk through an example.

Say a specification is released that has a large number of models, and some are released with the Primary tag, some are released with the Secondary tag, and some are released with no tag at all.

Autopilot will first begin processing the models with the Primary tag before moving on to the models with the Secondary tag. Now, Autopilot has moved on to the Secondary models, and someone has released another specification with their own Primary, Secondary, and no-tag models. The next model Autopilot will begin generating is the first Primary model from the new specification and generate all Primary models from the new specification before moving on to the Secondary models from the first specification.

Therefore, if many specifications are released all at once, Autopilot will constantly be processing Primary models and not move on to old Secondary models until all Primary models, no matter when they were released have been generated.

Grouping Model Generation by Specification

Tags are great when single specifications are being run and not bunched up together, but as soon as multiple specifications enter the picture, the order is jumbled and the time to complete generation for a given specification may actually take longer.

What if there were a way to ensure all models from one specification are generated before the next specification? There certainly is a way, and in concept, it is quite simple - just wait to release the models for the next specification.

Since this is DriveWorks, an automation software, there must be a way to automate the idea of waiting to release the models until the generation queue is empty instead of manually running the Transition/Operation from Live or Specification Explorer, and there is!

This automated method is based on four concepts:

  1. Existing projects that release models are reconfigured to use a transition leaving a paused state to release models.
  2. Another “meta-project” is configured to list all specifications in a pending paused state and which transition to run on the next specification once the model queue is empty.
  3. The Specification PowerPack contains a function SppIsModelQueueEmpty, which evaluates whether the model generation queue is empty, and is evaluated whenever a trigger value changes.
  4. The Scheduler DriveApp and Schedule Connector are configured to run a transition on the “meta-project” repeatedly to scan for new specifications to release models once the queue is empty.

A simple specification flow, which waits to release models, is shown below.

This specification will initially transition to “Saved”, which does not release any models. The ReleaseModels will then trigger the models to be released since the Release Models task is run on the Enter State of the following state.

How to Control DriveWorks Model Generation Order

Combining the use of tags and waiting to release models until the model queue is empty means that the desired order of model generation is preserved, while also ensuring each specification’s generation is complete before the next models are released.

This concludes how to control DriveWorks model generation order. Learn more about DriveWorks below. 

Learn More About DriveWorks

New Features in DriveWorks 22

Compare DriveWorks Packages: Features in DriveWorksXpress, Solo & Pro

DriveWorks Test Mode: Generate (On Demand) vs Generate (Queued Using Model Insight)

DriveWorks Child Specifications Explained

Managing Configurations with DriveWorks and SOLIDWORKS

VIEW ALL DRIVEWORKS TUTORIALS

 

About Isaac Smith

Isaac Smith is a SOLIDWORKS Technical Support Engineer at GoEngineer.

View all posts by Isaac Smith