Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamProject.cs =================================================================== diff -u -r1545 -r1900 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamProject.cs (.../DamProject.cs) (revision 1545) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamProject.cs (.../DamProject.cs) (revision 1900) @@ -431,7 +431,7 @@ } } dike.SoilList.AquiferDictionary.Clear(); - dike.SoilList.AquiferDictionary = newDict; + dike.SoilList.AquiferDictionary = newDict; } /// @@ -549,27 +549,30 @@ { for (int dikeIndex = 0; dikeIndex < damProjectData.WaterBoard.Dikes.Count; dikeIndex++) { - string sourceMapName = damProjectData.WaterBoard.Dikes[dikeIndex].MapForSoilGeometries2D; - if (!Directory.Exists(sourceMapName)) + if (!String.IsNullOrEmpty(damProjectData.WaterBoard.Dikes[dikeIndex].MapForSoilGeometries2D)) { - sourceMapName = Path.Combine(orgProjectMap, sourceMapName); - } - // Only copy files if map of geometries is assigned and exists - if (!String.IsNullOrEmpty(sourceMapName) && Directory.Exists(sourceMapName)) - { - string destMapname = CreateNewGeometry2DMapname(fileName, sourceMapName, dikeIndex); - string fullFilename = Path.GetFullPath(fileName); - string destFullMapname = Path.Combine(Path.GetDirectoryName(fullFilename), destMapname); - string orgFullMapname = Path.GetFullPath(sourceMapName); - if (!orgFullMapname.Equals(destFullMapname)) + string sourceMapName = damProjectData.WaterBoard.Dikes[dikeIndex].MapForSoilGeometries2D; + if (!Directory.Exists(sourceMapName)) { - CopyGeometries(orgFullMapname, destFullMapname); + sourceMapName = Path.Combine(orgProjectMap, sourceMapName); } - // Store the relative path to the 2d-geometries - damProjectData.WaterBoard.Dikes[dikeIndex].MapForSoilGeometries2D = destMapname; - foreach (Location location in damProjectData.WaterBoard.Dikes[dikeIndex].Locations) + // Only copy files if map of geometries is assigned and exists + if (!String.IsNullOrEmpty(sourceMapName) && Directory.Exists(sourceMapName)) { - location.MapForSoilGeometries2D = destMapname; + string destMapname = CreateNewGeometry2DMapname(fileName, sourceMapName, dikeIndex); + string fullFilename = Path.GetFullPath(fileName); + string destFullMapname = Path.Combine(Path.GetDirectoryName(fullFilename), destMapname); + string orgFullMapname = Path.GetFullPath(sourceMapName); + if (!orgFullMapname.Equals(destFullMapname)) + { + CopyGeometries(orgFullMapname, destFullMapname); + } + // Store the relative path to the 2d-geometries + damProjectData.WaterBoard.Dikes[dikeIndex].MapForSoilGeometries2D = destMapname; + foreach (Location location in damProjectData.WaterBoard.Dikes[dikeIndex].Locations) + { + location.MapForSoilGeometries2D = destMapname; + } } } }