• Informed Design

Informed Design for Inventor - author input rules with Codeblocks

Build a rule set to define constraint limits in your Inventor model.


Step-by-step guide

When creating an Informed Design product definition in Inventor, once the source content is defined and parameters are set in the desired order, you can author the rules to be used in the product definition.

Rules are authored using Google Blockly, a library for building beginner-friendly, block-based programming languages.

  1. Begin in the Product Definition dialog box, on the Rules tab. In this example, there are already constraints defined.

On the left is the Rules workspace toolbox, which has a variety of blocks sorted into categories, such as Logic, Math, Variables, and Functions. These are used to build block rules.

  1. Click each of the block categories to see the available blocks.
  • In the Informed Design product definition workspace, Rules tab, the Logic category of blocks expanded and highlighted, and constraints defined in the canvas.

The middle area of the workspace is the canvas. Here, constraints are defined for product customization.

On the side of the canvas are tools to zoom in or out, or delete blocks. Drag and drop blocks on the backpack to save them for reuse.

  • The canvas area of the Rules workspace, with constraints defined, and with the navigation tools, the receptable icon, and the backpack highlighted.

On the right side of the Rules workspace, the Form preview lists the adopted parameters in the order defined. Values can be entered and edited to test and preview behavior enforced by rules in the canvas.

At the top of the Form, the following synchronization controls are available:

  • Update form
  • Reset to defaults
  • Get model values from the Inventor model
  • Set model values to update the Inventor model using the Form values
  • In the Rules workspace, a zoomed in view of the Form preview, with the synchronization controls highlighted.

To create a new rule, add blocks to the canvas:

  1. In the toolbox, click Parameters. Select and drag the Height block to the top of the canvas.
  2. Click Math. Drag the top Value block and drop it directly onto the corresponding space in the Height parameter on the canvas. Notice that each block resembles a puzzle piece.
  • The Height block and the Math block connected on the canvas.

The Height entry in this block corresponds to the Height entry in the Form preview.

  • The Height block highlighted in the canvas and the corresponding field highlighted in the Form.
  1. For Height, change the value to min, and then enter a value of 20.
  2. In the Form, click Update form. The Form preview displays min 20 under the Height parameter.
  3. For the Height parameter, change the value to 18, and then press ENTER.

The value is rounded up to 20, as that is the minimum value set for this parameter.

  1. Hover the pointer over the Information icon for a more detailed explanation.
  • In the canvas, the Height block set to min with a value of 20; and in the Form, “min 20” displayed under the Height parameter, a value of 20 entered, and the hand pointer hovering over the information icon to display the message.
  1. Use CTRL+C and CTRL+V to copy and paste the Height block. Drag the duplicate and connect it below the Height block. An audible click confirms the connection.
  2. For this block, change the Value to max, and then set the value to 90.
  3. Update the form again. The rule under Height now displays as 20 to 90. Only values between 20 and 90 are accepted for this parameter.
  • In the canvas, the Height block copied and set to max, with a value of 90, and in the updated form, the new parameter limits shown below the input field.

To change an allowed min or max value, simply update the block with the new value, and then click Update form.

  1. Copy and paste the block two more times to create Width parameters with a min value of 20 and a max value of 46.
  2. Update the Form again to verify the corresponding rules update.
  • In the canvas, two Width blocks created with a min and max for the parameter, and in the updated form, the min and max displayed below the Width input field.

In addition to minimum and maximum rules, other options, such as increment, readOnly, or message rules can be applied.

Setting up rules here and publishing them allows the user to bring the model into the Revit environment with these controls as constraint limits set by the product manufacturer.

  1. To test rules, in the Form, click Set model values to update the Inventor model. The model updates in the graphics window.
  • In the form, the Set model values button highlighted.
  1. With source content defined, parameters set, and rules authored, click Save to save the product definition locally.