diff --git a/OSCADSharp/OSCADSharp/Solids/ImportedModel.cs b/OSCADSharp/OSCADSharp/Solids/ImportedModel.cs index 73108aa..8d60dac 100644 --- a/OSCADSharp/OSCADSharp/Solids/ImportedModel.cs +++ b/OSCADSharp/OSCADSharp/Solids/ImportedModel.cs @@ -29,6 +29,7 @@ namespace OSCADSharp.Solids public ImportedModel(string filePath) { this.filePath = filePath; + this.errorIfFileNotFound(); //TODO: Attempt to compute bounds } @@ -40,8 +41,18 @@ namespace OSCADSharp.Solids public ImportedModel(string filePath, Bounds bounds) { this.filePath = filePath; + this.errorIfFileNotFound(); + this.objectBounds = bounds; } + + private void errorIfFileNotFound() + { + if (!File.Exists(this.filePath)) + { + throw new FileNotFoundException("No model file was found at location: " + this.filePath); + } + } #endregion #region OSCADObject Overrides