mirror of
https://github.com/eliasstepanik/OSCADSharpDotnet7.git
synced 2026-01-26 04:18:27 +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)
|
public ImportedModel(string filePath)
|
||||||
{
|
{
|
||||||
this.filePath = filePath;
|
this.filePath = filePath;
|
||||||
|
this.errorIfFileNotFound();
|
||||||
//TODO: Attempt to compute bounds
|
//TODO: Attempt to compute bounds
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,8 +41,18 @@ namespace OSCADSharp.Solids
|
|||||||
public ImportedModel(string filePath, Bounds bounds)
|
public ImportedModel(string filePath, Bounds bounds)
|
||||||
{
|
{
|
||||||
this.filePath = filePath;
|
this.filePath = filePath;
|
||||||
|
this.errorIfFileNotFound();
|
||||||
|
|
||||||
this.objectBounds = bounds;
|
this.objectBounds = bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void errorIfFileNotFound()
|
||||||
|
{
|
||||||
|
if (!File.Exists(this.filePath))
|
||||||
|
{
|
||||||
|
throw new FileNotFoundException("No model file was found at location: " + this.filePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region OSCADObject Overrides
|
#region OSCADObject Overrides
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user