Hi Kartikeya,
The frames are patch objects, so as long as you can get the handles to these objects, you can enable and disable their visibility (what the "Frames" name-value argument is doing in bulk).
For example, suppose we show one of the built-in RigidBodyTree objects. For convenience, assume the visuals are already not shown, though this doesn't matter:
robot = loadrobot("abbIrb120");
show(robot,"Visuals","off");
You can find all the patch objects in the figure by using the findall command. >> allPatches = findall(gcf, "Type", "Patch")
allPatches =
16×1 Patch array:
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
You'll note that in the above example, all the patches are associated with a tag. This tag is unique to each rigidBodyTree.show command and specifies that these patch objects are affiliated with the rigid body tree object. If your figure contains more patches than those affiliated with the tree, you can limit selections by specifying that tag as part of the findall command:
allPatches = findall(gcf, "Type", "Patch", "Tag", "DO_NOT_EDIT_UwdU6")
Now all you need to do is figure out which of these patches is associated with the frame you'd like to disable, and turn it off. You can iterate over the list of patches and check if setting visibility off removes the patch from the corresponding figure. For example, the following call clearly removes the frame associated with link_4 located at the 90 degree angle:
allPatches(11).Visible='off'
If your rigid body tree object is the only item in the figure and the visuals are already off, an easy way to get this list is to reduce the scope of patches to those with visibility off.
visiblePatches =
9×1 Patch array:
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
Patch (DO_NOT_EDIT_UwdU6)
The list above corresponds to the list of frame patches.