Disabling and Enabling Blocks in VEXcode VR

VEXcode VR 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

disableneable.png

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

contextmenu.png

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


What happens to individual blocks when disabled

individualdisabled.png

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, the robot will not wait after driving in reverse, but will immediately turn right.


What happens when a block with nested blocks is disabled

nestedblocksdisabled.png

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. 

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

repeatdisabled.png

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

enablemainblock.png

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.

mainblockdisabled.png

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


Disabling and enabling a single nested block

disableandenable.png

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.

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

contextmenumain.png

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

nestedblockcontext.png

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


Disabling a “hat” block

disablehat.png

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

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

whenstartedhatdisabled.png

This image 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: