Why do you want to make a list of all the layouts? If you only want to erase the layout, then there is no need to go about making a list of them. If you have a reason for making a list, then we could code something up that will erase it if it's there, and if it's not (meaning doesn't match the name) when we will add it to the list.
I guess it would help us to understand what the whole program is going to be doing.
I need a list of the layouts so I can get the layout I need for plotting. There are two to three layouts, depending on the detail.
Some of these details have not been updated in a while and have no layout, just "Layout1". There is nothing set in it, not even a viewport. Some of these details have two or three layouts, "Layout1", "8.5 x 11", &/or "Detail1".
I'm doing a mass cleanup of these details so I can plot a DWF of them for the engineers. I have a proto called "8.5 x 11" I am pulling into the drawing. But I need to delete the old "8.5 x 11" and the "Layout1", then import the new "8.5 x 11" and set it as current, leaving the other layouts alone. Once I have the new "8.5 x 11" layout as current, I can use the variable 'cvport' to go in & zoom to its proper scale.
I'm just about there if I can figure out how to delete the 1, 2, or 3 layouts while keeping any others and setting a new imported layout as the current layout so I can plot it.
I hope this made sense, otherwise it's a really, really, really, really, really, really, really, really, really long story.