Set Field of View to 100°, Linear Speed to 10m/s or 10000mm/s
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello! I have code in C# using the Navisworks API, but I need to adjust some Linear Speed and Field of View (FOV) parameters.
I need to configure the following:
Field of View = 100º
LinearSpeed = 10m/s
However, I didn't find any property that could change and keep these values fixed.
The only thing I found was the following:
private void DefineLinearSpeed()
{
try
{
Viewpoint currentViewpointCopy = Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentViewpoint.CreateCopy();
// Set the LinearSpeed to 10
currentViewpointCopy.LinearSpeed = 1;
currentViewpointCopy.LinearSpeed = 32.81;
Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentViewpoint.CopyFrom(currentViewpointCopy);
}
catch (Exception ex)
{
MessageBox.Show($"Unable to set LinearSpeed.\nError: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void DefineFOV_100()
{
try
{
Viewpoint currentViewpoint = Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentViewpoint.CreateCopy();
// const double DegreesToRadians = Math.PI / 180;
// double fovInRadians = 48,359 * DegreesToRadians;
double testFOV1 = 0.73711;
// Sets the FOV (Field of View) to 100
currentViewpoint.HeightField = testFOV1;
Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentViewpoint.CopyFrom(currentViewpoint);
}
catch (Exception ex)
{
MessageBox.Show($"Unable to set FOV to 100.\nError: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}