Add a layer in a wall structure

Hi everyone,

I have a set of walls and I want to add a new structure layer to all of them. I can’t found a method in API to add layer at index, so I tried to get the orignal layers, set in a list, add my layer and set to wall again, but I lost information (e.g. what layers are external or internal)

csLayers = list()
layers= cs.GetLayers()

for l in layers:
if(cont == layerIndex):
csLayers.append(layerMaterial)
csLayers.append(l)
cont = cont + 1

cs.SetLayers(csLayers)

Any idea about another aproach to solve the problem?

Thanks

I think it would be much easier to set a new type to your elements, like so: