Community notifications may experience intermittent interruptions between 10–12 November during scheduled maintenance. We appreciate your patience.
Autodesk Informed Design defines a common framework for Industrialized Construction processes.
One of its key features is the application of CodeBlocks, a visual programming language first introduced by Tinkercad, to allow product engineers to specify the boundaries of parametric customization through algorithmic rules.
In this article, we will describe the Informed Design workflow and how CodeBlocks provides an accessible yet sophisticated solution for rules-based parametric productization, while meeting the requirements of flexibility, security, and platform independence.
We will also break down the main components of our CodeBlocks implementation for Informed Design, and demonstrate how Codeblocks provides a versatile platform for real-time rules validation.
Video tutorials: Informed Design Codeblocks
Autodesk Informed Design implements a three-step workflow that covers manufacturing, construction, and prefabrication (Figure 1), each performed by a distinctive persona: the Product Engineer, the Designer, and the Production Engineer.
The distinctive value of Informed Design is to automate the processes of validating rules, configuring the Product Model for use in a specific Building Model, and then automatically generating outputs with fabrication details.
Figure 1 – The Autodesk Informed Design Workflow
Codeblocks refers to the Tinkercad visual programming language, based on Google Blockly, and designed as an accessible language for learning algorithms by automating simple CAD operations.
The Blockly-based language implemented in Informed Design is distinct from Tinkercad’s Blockly-based language. While the goal in Tinkercad is to manipulate 3D elements, the Informed Design language targets the definition and application of rules for prefabricated construction. However, we chose to use the same nomenclature (i.e. Codeblocks) as both tools have more similarities than differences.
Informed Design CodeBlocks solution for prefabrication rules is made up of three main modules.
On Figure 2 we can see the Codeblocks implementation for the Inventor Add-in.
On the left side, there is the Enhanced Codeblocks Editor, and on the right side, the Customization Form. In the Revit Add-In, the Designer will only have access to the Customization Form, as this Inventor implementation is targeted to the Product Engineer. The Code Runner is the engine that enforces the rules in the Customization Form.
Figure 2 – The Enhanced Codeblocks Editor (left) and the Customization Form (right).
In order to enable manipulating Product Model parameters in Blockly, we adopted an approach based on object manipulation. This is achieved by introducing a getter statement for read and a setter statement for write (Figure 3.a).
Each of these blocks allows the selection of the targeted parameter (Figure 3.b) and the property that will be read or written (Figure 4.c).
Each parameter has its own set of properties depending on its type. For example, numeric parameters have range properties (min, max, increment), while boolean parameters (true/false) will have labels for each selection in case the Product Engineer would rather display the labels “Yes” and “No” instead of the default labels “True” and “False”.
Next, we present some of the logic that can be implemented with these getter and setter statements.
Figure 3 – Custom getter and setter blocks to manipulate Product Model parameters
One specific validator that is pre-implemented by the Code Runner is the range. On Figure 4, we observe that minimum and maximum values, and also the increment (step) are adjusted by declaration.
After each value change, the Code Runner is triggered, and based on these settings, it will act to validate the numbers or to adjust to the closest valid value.
Figure 4 – Range delimiters are pre-built into the Code Runner
In Figure 5, the rule specifies that the product can have a maximum area of 150 square feet. This rule is validated by checking if the multiplication of Width and Height is smaller than the threshold of 150 square feet.
If so, the Width value is automatically set to the maximum valid value calculated with a simple rule of three. The engineer can also use the message property to provide an explanation to the user of the reason for the adjustment.
Figure 5 – Rule: Max area is equal to 150 square feet.
Notice that pre-built rules and custom rules can be combined for a more fine-grained rule specification. In Figure 6, the combined usage of pre-built and custom rules ensures that the product area is no bigger than 150 square feet, as well as preventing disproportional values, like a product with a 1:150 ratio.
Learn more:
Learn about Codeblocks with the video tutorials on Autodesk learn
Visit the Autodesk Informed Design Knowledge Center (Blog) for more examples of Codeblocks in use.
Ask your Codeblock questions in the Informed Design Community Forum