& Construction

Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
& Manufacturing

Professional CAD/CAM tools built on Inventor and AutoCAD
Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
Professional CAD/CAM tools built on Inventor and AutoCAD
Set and get input values using the Parameter block in the Informed Design Codeblocks Rule Editor.
Type:
Tutorial
Length:
3 min.
Transcript
00:02
Setting and getting parameter values is a cornerstone of the Codeblocks workflow.
00:09
Here, we use an If Do block to get the value of the exterior panel material parameter and evaluate if it is set to “Steel Cladding”.
00:20
The Do portion of the block will set the value of the wall height parameter to 12 if the material is found to be Steel Cladding.
00:30
To ensure that the user cannot set the wall height to some other height when the cladding is in use,
00:37
we add a block to set the parameter to be read-only.
00:41
Finally, we duplicate the cladding Text block and add it to the block that sets the materials list values.
00:49
Testing the logic with the form shows that it works as expected
00:53
by setting the height parameter to be read-only and the value set to 12,
00:59
but only when Steel Cladding is set as the material.
01:03
In the following example, we use an If Do Else block to get the value of the wall height parameter,
01:10
to evaluate if that value is less than 8.
01:14
The existing Create List block is moved into the Do portion of the block
01:21
and then duplicated and added to the Else portion.
01:24
Two additional blocks are added to the list to include Steel and Aluminum Cladding.
01:30
The logical intent of the code blocks is to offer the user one list of values when the wall height is less than 8,
01:37
and a list with more options otherwise.
01:41
Just as parameters can be set to be read-only in the form,
01:46
they can also be set to be visible or not visible.
01:50
Here, an If Do block is replaced with an If Do Else block.
01:55
Then the interior material parameter is set to be visible only when the exterior material is Steel Cladding.
02:02
Using the exterior material control in the form to test the logic
02:09
shows that it hides the interior material parameter as expected.
02:14
Another way to accomplish the same thing is to set the visibility of the Interior Material parameter
02:22
to always be equal to the equation Exterior Panel Material equals Steel Cladding.
02:29
Once again, using the exterior material control in the form to test the logic
02:35
shows that it hides the interior material parameter as expected.
02:40
In summary, setting and getting parameter values is one of the most common code block tasks.
02:48
Similar to parameter values, lists of values can be set or get as well.
02:55
Setting parameters in the form to be visible or not visible,
03:01
as well as read-only or not read-only, is an option also.
Video transcript
00:02
Setting and getting parameter values is a cornerstone of the Codeblocks workflow.
00:09
Here, we use an If Do block to get the value of the exterior panel material parameter and evaluate if it is set to “Steel Cladding”.
00:20
The Do portion of the block will set the value of the wall height parameter to 12 if the material is found to be Steel Cladding.
00:30
To ensure that the user cannot set the wall height to some other height when the cladding is in use,
00:37
we add a block to set the parameter to be read-only.
00:41
Finally, we duplicate the cladding Text block and add it to the block that sets the materials list values.
00:49
Testing the logic with the form shows that it works as expected
00:53
by setting the height parameter to be read-only and the value set to 12,
00:59
but only when Steel Cladding is set as the material.
01:03
In the following example, we use an If Do Else block to get the value of the wall height parameter,
01:10
to evaluate if that value is less than 8.
01:14
The existing Create List block is moved into the Do portion of the block
01:21
and then duplicated and added to the Else portion.
01:24
Two additional blocks are added to the list to include Steel and Aluminum Cladding.
01:30
The logical intent of the code blocks is to offer the user one list of values when the wall height is less than 8,
01:37
and a list with more options otherwise.
01:41
Just as parameters can be set to be read-only in the form,
01:46
they can also be set to be visible or not visible.
01:50
Here, an If Do block is replaced with an If Do Else block.
01:55
Then the interior material parameter is set to be visible only when the exterior material is Steel Cladding.
02:02
Using the exterior material control in the form to test the logic
02:09
shows that it hides the interior material parameter as expected.
02:14
Another way to accomplish the same thing is to set the visibility of the Interior Material parameter
02:22
to always be equal to the equation Exterior Panel Material equals Steel Cladding.
02:29
Once again, using the exterior material control in the form to test the logic
02:35
shows that it hides the interior material parameter as expected.
02:40
In summary, setting and getting parameter values is one of the most common code block tasks.
02:48
Similar to parameter values, lists of values can be set or get as well.
02:55
Setting parameters in the form to be visible or not visible,
03:01
as well as read-only or not read-only, is an option also.
To begin, create a code block that sets a nominal wall height parameter value when a specific exterior panel material is used, and ensure that the value cannot be changed for that material.
When Steel Cladding is selected, a read-only value of 12 is applied, and when the other options are selected, the parameter value can be edited.
Next, use the If Do Else block to create a code block that offers a specific list of materials when the parameter is less than 8, and otherwise, a list with more options.
Parameters can also be set to be visible or not visible when certain conditions are met.
Now, if the Exterior Panel Material is Steel Cladding, then the Interior Panel Material parameter will be visible. For all other exterior materials, the interior material parameter will be hidden.
To test the logic:
Another way to accomplish the same thing is to set the visibility of the interior material parameter to always be equal to the equation Exterior Panel Material equals Steel Cladding, as shown below.
In summary, setting and getting parameter values, or lists of parameter values, is one of the most common code block tasks. Additionally, parameters can be set to be visible or not visible, as well as to be read-only.
How to buy
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © 2025 Autodesk Inc. All rights reserved
Sign in for the best experience
Save your progress
Get access to courses
Receive personalized recommendations
May we collect and use your data?
Learn more about the Third Party Services we use and our Privacy Statement.May we collect and use your data to tailor your experience?
Explore the benefits of a customized experience by managing your privacy settings for this site or visit our Privacy Statement to learn more about your options.