Disabling and Enabling Blocks in VEXcode IQ

VEXcode Blocks allows users to disable and enable blocks within their projects. This is a useful feature for testing or debugging a project without having to take the project apart. The user can disable or enable a block(s) to test the differences in the robot’s behavior when that block is or is not in the project.


How to disable and enable blocks

Collage of VEX IQ robotics projects showcasing various robot designs and programming concepts, illustrating educational resources and tutorials available in the Blocks Tutorials section of the VEX IQ knowledge base.

To disable a block, right-click or long-press on the block to activate the Context Menu and then select Disable Block.

Screenshot showing the enable and disable options for blocks in VEXcode IQ programming, illustrating the user interface for managing programming blocks in the VEX IQ Robotics platform.

To enable a disabled block, activate the Context Menu for that block and select Enable Block.


What happens to individual blocks when disabled

Screenshot showing how to disable a feature in VEXcode IQ, illustrating the user interface and options available for programming VEX IQ robots, relevant to Blocks Tutorials in the VEX IQ knowledge base.

While a block(s) is disabled, it is shown grayed out with a grid of diagonal lines over it.

The disabled block is treated like a comment. It has no effect on the flow of the project.

In the example project above, the robot will not wait after driving in reverse, but will immediately turn right.


What happens when a block with nested blocks is disabled

When you disable a block with blocks nested within it, all of the blocks are disabled. Blocks like a loop or if-then-else conditional, that have nested blocks, can be disabled in the same way a single block can. 

Image showing a blocked or disabled programming block in VEXcode IQ, illustrating a common issue encountered in coding for VEX IQ Robotics projects. This visual aids in understanding troubleshooting within the Blocks Tutorials section.

Activate the Context Menu of that loop or conditional Control block, and then select Disable Block.

Screenshot of the VEXcode IQ interface showing a disabled block in the programming environment, illustrating the Blocks Tutorials section for VEX IQ Robotics platform users.

The image below shows what happened when the repeat loop was disabled. The loop and the two blocks inside of it were all disabled.

Screenshot of the VEXcode IQ interface showing the 'Enable Block' feature, used in programming VEX IQ robots. This image is part of the Blocks Tutorials section, aimed at helping educators and students learn to build and program robots effectively.

You can enable the main block and all nested blocks within it by activating the Context Menu of the main block and selecting Enable Block.

Diagram illustrating nested blocks in VEXcode IQ programming, showcasing how to organize and structure code for VEX IQ robotics projects. Relevant for beginners learning programming concepts in the Blocks Tutorials section of the VEX IQ knowledge base.

When the main block is enabled, all nested blocks will also be enabled.


Disabling and enabling a single nested block

You can disable single blocks within a loop or if-then-else by following the same steps for disabling any other block: activate that block’s Context Menu and choose Disable Block.

Diagram illustrating a loop structure in VEXcode IQ programming, showcasing the concept of nested loops for educational purposes in robotics, as part of the Blocks Tutorials in the VEX IQ knowledge base.

Here is an example of only disabling a single block within a loop.

Diagram illustrating the context menu options in VEXcode IQ for the VEX IQ Robotics platform, showcasing features relevant to Blocks Tutorials for educational robotics programming.

The Context Menu for the main block will not provide an option for enabling the nested block because the main block was not disabled.

Screenshot showing the VEXcode IQ interface with a highlighted block programming example, illustrating how to disable a hat in a robotics project tutorial for VEX IQ users.

If later you want to enable that nested block, you will need to activate its Context Menu.


Disabling a “hat” block

You can disable an entire stack of blocks by disabling the “hat” block that contains them all. 

Screenshot of the context menu for Blocks Tutorials in the VEX IQ knowledge base, displaying options and resources related to programming and building with VEX IQ robotics kits for educational purposes.

Activate the Context Menu of the “hat” block, and then select Disable Block.

Screenshot of the VEXcode IQ interface showing a disabled edit block for programming VEX IQ robots, illustrating the Blocks Tutorials section in the knowledge base.

The image below shows what happened when the When Started “hat” block is disabled. All of the blocks contained under the When Started block will not run.

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: