07-01-2019, 04:01 PM
In the RoboDK UI application, right clicking on the open station brings up a context menu which gives the user the 'Add Folder' option, which does not seem to be possible using the Python API. After checking the robolink Item() class, I found that folders are valid Item objects and calling Type() on them returns 17, but there is no ITEM_TYPE_* variable assigned to that value as there are for other types of Items. Also, there are no methods to allow the user to add or manipulate folder Items.
I was able to work around this and create new folders by using Copy(), Paste(), and setName() on an existing folder and then using setParent() to add Items to the new folder, but that only works if the user has already added an empty folder using the UI. Is there any way to add and manipulate folder Items directly that I might be missing? If not, that would be a good feature to implement in the future as folders are extremely useful for organizing things like targets and programs, which tend to clutter up the station tree.
I was able to work around this and create new folders by using Copy(), Paste(), and setName() on an existing folder and then using setParent() to add Items to the new folder, but that only works if the user has already added an empty folder using the UI. Is there any way to add and manipulate folder Items directly that I might be missing? If not, that would be a good feature to implement in the future as folders are extremely useful for organizing things like targets and programs, which tend to clutter up the station tree.