Informed Design Knowledge Center
Share and learn how-to tips, workflows, and general knowledge articles about Informed Design and the future of the Industrialized Construction industry.

Autodesk Informed Design Codeblock Best Practices

Codeblock Best Practices Thumbnail.png

Autodesk Informed Design Codeblocks empower users to create code through an intuitive drag-and-drop interface, eliminating the need for traditional text-based programming. 

 

Autodesk Informed Design utilizes Google Blockly, a Google library renowned for crafting user-friendly, block-based programming languages, to deliver the Codeblocks functionality included, which is used to define Product input and interface logic without the need to write text-based code.

 

Video tutorials: Informed Design Codeblocks

 

Codeblocks, where to start?

 

Start with simple tasks. Familiarize yourself with the Codeblocks interface and understand the dynamics of block interaction. The Informed Design Help page for the Rules Workspace provides excellent resources to comprehend the toolbox, canvas, contextual menus, form previews, etc. As you become more comfortable, gradually undertake more complex projects.

 

 

bp-codeblocks-1.png

 

Begin by using the sample datasets provided for download HERE, or create your own basic product model datasets to work with while learning the basics.

 

Planning Ahead

 

Before embarking on this journey, clarity of purpose is crucial. Plan out your input rules and sketch the logical flow. Always start simple. For instance, consider whether your rules need to control the maximum and/or minimum value, or control the value increments allowed for an input. This approach simplifies block selection and rule organization.

 

 

bp-codeblocks-2.png
 
As you progress, adding complexity can be as simple as integrating an If/do block. Here, you can include a conditional statement filled with variables and parameter blocks. The 'do' section of the block in the example below sets the value a specified parameter and defines what value options are available for that parameter's Input control (drop down list) when the condition is met that is specified in the 'if' section of the block.
 
bp-codeblocks-3.png
 

Test, test, test

 

Don’t learn the hard way by creating all your rules and then testing them when you're done, only to find that things (perhaps many) are not working properly.

 

Instead, as you are building the blocks, test them as you go. Run tests (Click on "Update Form" in the Rules workspace) frequently to check for errors and make sure your rules are behaving as expected. Also, consider breaking your rules down into smaller parts (groups of blocks) and testing each part individually before combining them into a larger program.

 

 

bp-codeblocks-4.png

 

To help with this, we recommend watching the following tutorials on Autodesk Learn:

Video tutorials: Informed Design Codeblocks

 

Reuse Codeblocks

 

Don’t just keep creating the same sequences of codeblocks over and over again.

 

Consider creating a reusable function to encapsulate your code and drop  into the backpack for quick access when you need it elsewhere in your codeblocks construct. This will help streamline the creation of your rules and make it easier to maintain.

 

For functions you define that can be used across product definitions, you can export the Function to a file and import it into any other product definition.

 

Isolate the codeblocks you want to export in their workspace before exporting, because currently, the Export function only Exports all Codeblocks in the canvas.

 

bp-codeblocks-5.png

Tutorials and Help Documentation

 

Take advantage of the Learning Tutorials to learn how to use the tool effectively. Taking advantage of these resources can deepen your understanding of the solution and help you learn various techniques typically employed to accomplish common tasks. 

Stay Informed

 

Informed Design is continually being improved and updated with new features and enhancements. Sign up for our Newsletter to stay informed about these updates so you can take full advantage of the benefits as soon as they are made available.  

 

Connect with Us

 

Head over to the Informed Design Community Forum to engage with other users, our team, share your tips and tricks, and get your questions answered.

 

Share your Ideas

 

Do you have ideas about how we could improve Informed Design?  Are there new functions or capabilities you would like to see added?  If so, please let us know by posting your ideas on the Informed Design IdeaStation.