Hello
I will use the "Layer[0].Name" as in the modified snippet, I have not tried to delete all layer and see what happens, maybe i will check this case.
Maybe with the EnsureActiveLayer() ?
As the "Default Layer" name is changing between languages, how to retrieve the "default name" despite the language.
ActiveLayer.name (in CamBam.CAD.CADFile)
there is no default name as for Entities, so the layer name used as default is always dependent of the language.
how to contribute to the pages on ateliers..
Currently, the API website is abandoned because too difficult to maintain up to date with no info from Andy when something change and also because all the pages are done by hand ... so I prefer to add the snippets on the forum.
Another reason is that it is more convenient to search for a snippet with a title like "layer management" than to search in the API by classes to find an associated snippet ; ex: in the case of layer what we need are in CADfile, Layer, Layer collection ... and you need to know that ... not easy for beginners ...
Andy as started a GIT to handle CamBam resources and hopefully He will add a more convenient way to handle the API doc in the future.
++
David