Set wall compound layers from a list

Hi,

I’m struggling to import back wall compound layers name into Revit. I worked on few options based on different topics I found on the forum and it seems i’m not too far from a result I want.
Here are the options I worked on and my issues :

Option 1 : With FamilyType.SetCompoundLayerMaterial by Clockwork
I think it’s the more advanced option, It works partially when lacing longest so think my issue comes from the string “layer index” and his structure, could be replication guides the solution ?

Option 2 : With Element.SetParameterByName
I simply tried this option, trying with parameter name that I found in python code from clockwork but it doesn’t work and I have a error message. I think it’s much more complicated with this kind of element.

Option 3 : Material.SetMaterialAssetByAssetId by Clockwork
I have no error message but it doesn’t work really, element ID might be not the good node to use, I tried with element name with the same result.

Here attached a screenshot and the script.
Any suggestions would be much appreciated.

Flavien

Structure_Layers_Import.dyn (29.3 KB)