& 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
Setting and getting parameter values is a cornerstone of the code blocks workflow. 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.
Type:
Tutorial
Length:
3 min.
Transcript
00:03
Setting and getting parameter values is a
00:06
cornerstone of the code block's workflow.
00:10
Here we use an if do block to get the value of the exterior panel material parameter
00:16
and evaluate if it is set to steel cladding,
00:21
the due portion of the block will set the value of the wall height parameter to 12.
00:27
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.
00:35
When the cladding is in use,
00:37
we add a block to set the parameter to be read only.
00:42
Finally,
00:42
we duplicate the cladding text block and add it
00:45
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
00:57
and the value set to 12 but only when steel cladding is set as the material.
01:04
In the following example,
01:06
we use an if do else block to get the value of the
01:09
wall height parameter to evaluate if that value is less than eight.
01:16
The existing create list block is moved into the due portion of
01:20
the block and then duplicated and added to the L 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
01:34
one list of values when the wall height is less than eight
01:38
and a list with more options. Otherwise
01:42
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:54
then the interior material parameter is set to be
01:57
visible only when the exterior material is steel cladding.
02:04
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:15
Another way to accomplish the same thing is
02:18
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
02:34
the logic shows that it hides the interior material parameter as expected
02:41
in summary setting and getting parameter values is
02:45
one of the most common code block tasks
02:49
similar to parameter values. Lists of values can be set or get as well
02:57
setting parameters in the form to be visible or not visible as
03:01
well as read only or not read only is an option also.
Video transcript
00:03
Setting and getting parameter values is a
00:06
cornerstone of the code block's workflow.
00:10
Here we use an if do block to get the value of the exterior panel material parameter
00:16
and evaluate if it is set to steel cladding,
00:21
the due portion of the block will set the value of the wall height parameter to 12.
00:27
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.
00:35
When the cladding is in use,
00:37
we add a block to set the parameter to be read only.
00:42
Finally,
00:42
we duplicate the cladding text block and add it
00:45
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
00:57
and the value set to 12 but only when steel cladding is set as the material.
01:04
In the following example,
01:06
we use an if do else block to get the value of the
01:09
wall height parameter to evaluate if that value is less than eight.
01:16
The existing create list block is moved into the due portion of
01:20
the block and then duplicated and added to the L 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
01:34
one list of values when the wall height is less than eight
01:38
and a list with more options. Otherwise
01:42
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:54
then the interior material parameter is set to be
01:57
visible only when the exterior material is steel cladding.
02:04
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:15
Another way to accomplish the same thing is
02:18
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
02:34
the logic shows that it hides the interior material parameter as expected
02:41
in summary setting and getting parameter values is
02:45
one of the most common code block tasks
02:49
similar to parameter values. Lists of values can be set or get as well
02:57
setting parameters in the form to be visible or not visible as
03:01
well as read only or not read only is an option also.
The due portion of the block will set the value of the wall height parameter to twelve if the material is found to be steel cladding.
To ensure that the user cannot set the wall height to some other height when the cladding is in use, we add a block to set the parameter to be read only.
Finally, we duplicate the cladding text block and add it to the block that sets the materials list values.
Testing the logic with the form shows that it works as expected by setting the height parameter to be read only and the value set to twelve, but only when steel cladding is set as the material.
In the following example, we use an if do else block to get the value of the wall height parameter to evaluate if that value is less than eight.
The existing create list block is moved into the due portion of the block and then duplicated and added to the else portion.
Two additional blocks are added to the list to include steel and aluminum cladding.
The logical intent of the code blocks is to offer the user one list of values when the wall height is less than eight. And a list with more options otherwise.
Just as parameters can be set to be read only in the form They can also be set to be visible or not visible.
Here, an if do block is replaced with an if do else block. Then the interior material parameter is set to be visible only when the exterior material is steel cladding.
Using the exterior material control in the form to test the logic, shows that it hides the interior material parameter as expected.
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.
Once again, using the exterior material control in the form to test the logic shows that it hides the interior material parameter as expected.
In summary, setting and getting parameter values is one of the most common code block tasks.
Similar to parameter values, lists of values can be set or get as well.
Setting parameters in the form to be visible or not visible as well as read only or not read only is an option also.
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.