Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamEngineIo/FillXmlInputFromDamUi.cs =================================================================== diff -u -r6287 -r6289 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamEngineIo/FillXmlInputFromDamUi.cs (.../FillXmlInputFromDamUi.cs) (revision 6287) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamEngineIo/FillXmlInputFromDamUi.cs (.../FillXmlInputFromDamUi.cs) (revision 6289) @@ -111,7 +111,7 @@ input.Soils = new DamEngine.Io.XmlInput.Soil[dike.SoilList.Soils.Count]; TransferSoils(usedSoils, input.Soils); - TransferTrafficLoadDegreeOfConsolidation(dike.TrafficLoadDegreeOfConsolidations, input); + TransferTrafficLoadDegreeOfConsolidation(dike.TrafficLoadDegreeOfConsolidations, usedSoils, input); if (damProjectData.InputTimeSerieCollection != null) { @@ -720,19 +720,24 @@ } } - private static void TransferTrafficLoadDegreeOfConsolidation(IList trafficLoadDegreeOfConsolidations, Input input) + private static void TransferTrafficLoadDegreeOfConsolidation(IList trafficLoadDegreeOfConsolidations, List usedSoils, Input input) { InputTrafficLoadDegreeOfConsolidation[] inputTrafficLoadDegreeOfConsolidations; if (trafficLoadDegreeOfConsolidations != null && trafficLoadDegreeOfConsolidations.Count > 0) { - inputTrafficLoadDegreeOfConsolidations = new InputTrafficLoadDegreeOfConsolidation[trafficLoadDegreeOfConsolidations.Count]; - for (var i = 0; i < trafficLoadDegreeOfConsolidations.Count; i++) + inputTrafficLoadDegreeOfConsolidations = new InputTrafficLoadDegreeOfConsolidation[usedSoils.Count]; + var index = 0; + foreach (TrafficLoadDegreeOfConsolidation trafficLoadDegreeOfConsolidation in trafficLoadDegreeOfConsolidations) { - inputTrafficLoadDegreeOfConsolidations[i] = new InputTrafficLoadDegreeOfConsolidation() + if (usedSoils.Any(soil => string.Equals(soil.Name, trafficLoadDegreeOfConsolidation.SoilName, StringComparison.OrdinalIgnoreCase))) { - SoilName = trafficLoadDegreeOfConsolidations[i].SoilName, - DegreeOfConsolidation = trafficLoadDegreeOfConsolidations[i].DegreeOfConsolidation - }; + inputTrafficLoadDegreeOfConsolidations[index] = new InputTrafficLoadDegreeOfConsolidation() + { + SoilName = trafficLoadDegreeOfConsolidation.SoilName, + DegreeOfConsolidation = trafficLoadDegreeOfConsolidation.DegreeOfConsolidation + }; + index += 1; + } } } else Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DamEngineIo/FillXmlInputFromDamUiTests.cs =================================================================== diff -u -r6286 -r6289 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DamEngineIo/FillXmlInputFromDamUiTests.cs (.../FillXmlInputFromDamUiTests.cs) (revision 6286) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DamEngineIo/FillXmlInputFromDamUiTests.cs (.../FillXmlInputFromDamUiTests.cs) (revision 6289) @@ -29,7 +29,6 @@ using Deltares.DamEngine.Io; using Deltares.DamEngine.Io.XmlInput; using Deltares.Geometry; -using Deltares.Geotechnics; using Deltares.Geotechnics.Soils; using Deltares.Geotechnics.SurfaceLines; using Deltares.Standard.EventPublisher;