PrintNowPrintNowDocs

Conditional Geometry

Make parts of a dieline switch on and off with a condition, so one Print CAD file covers a whole product family, and drive the switch from a pricing option.

Conditional geometry lets one dieline cover a whole product family. You put optional parts, such as a hang hole, a window or a zipper, in a group with a condition. When the condition is false, those lines drop out of the dieline, the 3D preview and the print-ready PDF.

A customer turns the parts on and off by choosing a product option, such as "Add a window". The option sets a switch variable, and the variable decides each condition.

The setup has three parts:

  1. In Print CAD: put the optional lines in a conditional group and give it a condition.
  2. On the standard: mark the switch variable Unitless.
  3. In pricing: add an order option that sets the variable.

Add a Condition in Print CAD

  1. Activate a workplane (Sketch > In Workplane).
  2. Choose New Conditional Group. The new group is named conditional. The menu item shows only in 2D view.
  3. Draw the optional lines (for example, a hang hole) in this group.
  4. Open the group's info screen. Next to condition, click [change].
  5. Type the condition and press Enter. For example, HANGHOLE == 1.

Any sketch-in-workplane group has a condition row, so you can also add a condition to a group you already drew. A group with no condition shows (always active). To remove a condition, clear the text.

If the condition names a variable that doesn't exist yet, Print CAD asks Add new variable: Define value for "HANGHOLE":. Enter a starting value, such as 0. If you cancel, the condition is not changed.

Condition Syntax

Conditions use the same expressions as constraints (see Expression System), plus comparison and logic operators.

OperatorsExample
Comparison: == != < > <= >=WINDOW > 0
Logic: && (and), || (or)WINDOW == 1 && ZIPPER == 1
Choice: ? :STYLE == 2 ? 1 : 0
Arithmetic and functions: + - * /, min, max, step, clampmin(WINDOW, 1) == 1

The result is a whole number. Any value other than 0 means the group is on. Use == to compare, never a single =.

Check the Group's Status

When a group has a condition, a status line under it shows what the condition gives at the current variable values:

StatusMeaning
active at current valuesThe condition is true. The group's lines are in the dieline.
inactive at current valuesThe condition is false. The group's lines drop out.
unknown variable 'NAME'The condition uses a variable that doesn't exist.
invalid expressionThe condition can't be read. Check the syntax.

The status is for information only. Print CAD still shows and lets you edit the group's lines. To test each variant, change the variable in Edit > Variables... and check the status.

Switch Variables

Variables used only in conditions hold codes such as 0, 1 and 2, not measurements. Print CAD keeps them as plain unitless numbers and saves them with the file, even when no dimension uses them. Desktop and web both behave the same. See Variables.

Mark the Variable Unitless

After you upload the file, open the standard in the admin and go to the Parameters tab. Edit the switch variable and check Unitless (a code, not a measurement).

If a switch variable is not marked Unitless, a standard that uses inches converts it like a size, and the value the pricing option sends no longer matches the condition.

Bind the Variable to a Pricing Option

A pricing order option drives a switch variable through its Integration Id. There is no picker; you type the IDs, the same way you bind materials and boards.

  1. Open the product's base pricing and go to the Order Options tab.
  2. Add an order option, for example "Window".
  3. Set the option's Integration Id to parametric:variable:NAME, where NAME is the variable. For example, parametric:variable:WINDOW.
  4. Add one option item per value. Set each item's Integration Id to the value the item sends. For example, "No window" = 0 and "Clear window" = 1.
WhereIntegration Id
Order option "Window"parametric:variable:WINDOW
Option item "No window"0
Option item "Clear window"1

When the customer picks an item, the variable takes its value. The dieline, the 3D preview and the PDF update to match.

Locked After Design

Once the customer has a design, options that switch dieline features are locked in the calculator, the same as die-mapped options. This keeps the artwork matched to the dieline.

What Changes When a Group Is Off

  • Dieline: the group's lines are removed.
  • 3D preview: the feature (window, zipper, hang hole) disappears from the model.
  • Print-ready PDF: the group's lines don't appear on any spot plate. See Dieline Spot Plates.
  • Flexible Packaging — draw pouches and bags with seals, windows and zippers
  • Variables — create and name the variables a condition uses
  • Parameters — mark switch variables Unitless
  • Pricing — set up the order options that drive the switch

On this page