mirror of
https://github.com/eliasstepanik/OSCADSharpDotnet7.git
synced 2026-01-11 21:48:34 +00:00
Added error if file not found for model import
This commit is contained in:
parent
6de63fa3c6
commit
8741b7df2a
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user