I understand your method,Actually,I did a test to repeat the
1.I creat 20 layers by coding,the 20 layers can be seen in the layer dialog. (Rhino.RhinoDoc.ActiveDoc.Layers.Add(layer))
2.I delete 20 layers,the 20 layers just created in the last stepdisappeared in the layer dialog .(RhinoDoc.ActiveDoc.Layers.Purge(i, True) or RhinoDoc.ActiveDoc.Layers.Delete(i, True))
3.When I check the layers count,It still returns 20.( Rhino.RhinoDoc.ActiveDoc.Layers.Count)
4.Repeat several times add and delete processing(different layers number),the count of layer only can be increasing but decreasing.After that I can’t get the correcting index of the layer.
5.So I guess the layer table can’t be delete.Is that right? If I want to make each layer corresponding with my slicing layer of the model,how to make it?