Hi all,
Trying to replace the material of a layer within a compound structure but getting one of those annoying errors you can’t work out.
My code:
if cs:
layers = cs.GetLayers()
# Iterate through the layers and replace the material
for i in range(len(layers)):
if layers[i].MaterialId == find_material.Id:
TransactionManager.Instance.EnsureInTransaction(doc)
#layers[i].MaterialId = replace_material.Id
cs = CompoundStructure.SetMaterialId(i, replace_material.Id)
changed = True
This is my error:
This is the API docs page where; as far as I can see, there are only two arguments ?
CompoundStructureLayer Class (revitapidocs.com)
Any idea what argument I’m supposedly missing?