When deleting (sub)layers an error occurs: [layer name] does not exist in LayerTable
.
My code:
import rhinoscriptsyntax as rs
layers = rs.LayerNames()
for layer in layers:
if rs.IsLayerEmpty(layer) and layer != 'aLayerName':
rs.DeleteLayer(layer)
Is there a way to update the LayerTable each time a layer is deleted?
(Solution on Python please.)
Kind regards, Dick