On 16/07/2014 at 13:36, xxxxxxxx wrote:
Theres lots of documentation on how to create and manipulate layers but is there no way to delete a layer? Just to be clear I don't mean deleting an object from a layer, just deleting the actual layer.
Thanks for any help on this.
On 16/07/2014 at 16:43, xxxxxxxx wrote:
Use Remove() the same way as deleting an object from the OM.
def main() :
root = doc.GetLayerObjectRoot() #Gets the layer manager
LayersList = root.GetChildren() #The actual layers in the manager
#Looks for a layer named myLayer
#Then deletes it if it's found
for layer in LayersList:
if layer.GetName()== "myLayer":
On 17/07/2014 at 07:28, xxxxxxxx wrote:
Thanks Scott! I tried almost this same setup, only I did a noob move and forgot the EventAdd so I couldn't tell it was being deleted. OOPS! Thanks a bunch