- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I want to change the material on all the layers of Walls and Floors to the same material
I get the MaterialId, loop through all the Layers, make a new layer with the same thicknes and function but with the new material and then set the layer to match the new layer, but... it doesn't work
What do I do wrong ??
My code look like this:
public void ChangeMaterialonLayers(CompoundStructure LC_CS, ElementId MatId)
{
IList<CompoundStructureLayer> cslayers = LC_CS.GetLayers();
int LayerIndex = 0;
foreach (CompoundStructureLayer csl in cslayers)
{
CompoundStructureLayer TempLayer = new CompoundStructureLayer(csl.Width, csl.Function, MatId);
LC_CS.SetLayer(LayerIndex, TempLayer);
LayerIndex++;
}
}
Regards Anders
Solved! Go to Solution.