I am developing a method that clears any existing slot labels before repainting slot labels based on an external file using the function_s method.
Here is my code that removes the 'SegmentA' label's subnode under the slot's 'slotLables' and 'resetLabels' nodes.
Storage.Object rack = Model.find("Rack_D40_A"); for (int i = 1; i <= rack.bays.length; i++) { Storage.Bay bay = rack.bays[i]; for (int j = 1; j <= bay.levels.length; j++) { Storage.Level level = bay.levels[j]; for (int k = 1; k <= level.slots.length; k++) { treenode mytreeslot = level.slots[k].as(treenode); // This destroys the slotLabels subnodes if (mytreeslot.find("slotLabels")) { treenode myslotLabels = mytreeslot.find("slotLabels"); if ( myslotLabels.find("SegmentA") ) { myslotLabels.find("SegmentA").destroy(); } } else { //msg("hello","slotLabels do not exist"); } // This destroys the resetLabels subnodes if (mytreeslot.find("resetLabels")) { treenode myresetLabels = mytreeslot.find("resetLabels"); if ( myresetLabels.find("SegmentA") ) { myresetLabels.find("SegmentA").destroy(); } } else { //msg("hello","resetLabels do not exist"); } } } }
The problem is that after I run the code and verify the labels have been removed from the Tree, the 'Paint Slot Labels' tool will still show the labels applied until I select a different slot label in the properties panel and then re-select the label that I had removed to see the change...
How do I get the 'Paint Slot Labels' tool to auto refresh and reflect the change to the Tree?? I realize this is rather minor, but I think I am just missing some reset/refresh command in my code. Thanks - Stan