Although the items in the folders of Origins, Sketches and Constructions have the corresponding API objects, the visibility of the folders are controlled by the following flags:
rootComponent.isSketchFolderLightBulbOn
rootComponent. isOriginFolderLightBulbOn
rootComponent. isConstructionFolderLightBulbOn
The usage is quite straightforward. Just set True or False will be same to what end user clicks the folder bulb on / off.