Index: DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.LayerCreator/SurfacelineProcessor.cs =================================================================== diff -u -r3192 -r3215 --- DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.LayerCreator/SurfacelineProcessor.cs (.../SurfacelineProcessor.cs) (revision 3192) +++ DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.LayerCreator/SurfacelineProcessor.cs (.../SurfacelineProcessor.cs) (revision 3215) @@ -39,8 +39,15 @@ { surfaceLine = orgSurfaceLine; dikeTopPolder = surfaceLine.GetSurfaceLinePointByType(CharacteristicPointType.DikeTopAtPolder); + if (dikeTopPolder == null) + { + throw new Exception(string.Format("Surface line {0} has no Dike Top.", surfaceLine.SurfaceLineId)); + } dikeToePolder = surfaceLine.GetSurfaceLinePointByType(CharacteristicPointType.DikeToeAtPolder); - + if (dikeToePolder == null) + { + throw new Exception(string.Format("Surface line {0} has no Dike Toe.", surfaceLine.SurfaceLineId)); + } } /// Creates the lowered surface line. @@ -68,6 +75,7 @@ } } } + loweredSurfaceLine.SurfaceLineId = surfaceLine.SurfaceLineId + "_low"; return loweredSurfaceLine; } Index: DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.LayerCreator/LayerCreator.cs =================================================================== diff -u -r3214 -r3215 --- DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.LayerCreator/LayerCreator.cs (.../LayerCreator.cs) (revision 3214) +++ DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.LayerCreator/LayerCreator.cs (.../LayerCreator.cs) (revision 3215) @@ -101,10 +101,9 @@ loggedLocations.Add(string.Format("Handling location {0} with surface line {1}", location.LocationId, location.SurfacelineId)); WriteToLog(loggedLocations); SurfaceLine surfaceLine = FindSurfaceLine(location.SurfacelineId); - var loweredSurfaceLine = DetermineSurfaceLineForGivenLayerData(surfaceLine, location.LayerThickness); - try { + var loweredSurfaceLine = DetermineSurfaceLineForGivenLayerData(surfaceLine, location.LayerThickness); CreateGeometryWithLoweredSurfaceLine(loweredSurfaceLine, location); CreateGeometryWithOriginalSurfaceLine(surfaceLine, location); }