Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5835

Python: deleting layers and sublayers

$
0
0

@dick.lelyveld wrote:

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

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5835

Latest Images

Trending Articles



Latest Images