Hi!
I want to add a list of viewpoints to a animation in Navisworks, using the .NET API. I have been able to store all of the viewpoints from my list in the savedViewpoints list, using the following code:
public List<Viewpoint> ViewPointList { get; private set; }
private Document oDoc = Autodesk.Navisworks.Api.Application.ActiveDocument;
public void AddViewPointToAnimation()
{
// get current viewpoint
Viewpoint oCurVP = oDoc.CurrentViewpoint.CreateCopy();
ViewPointList.Add(oCurVP);
}
public void CreateAnimation()
{
oDoc.SavedViewpoints.Clear();
foreach (Viewpoint point in ViewPointList)
{
SavedViewpoint sVpoint = new SavedViewpoint(point);
oDoc.SavedViewpoints.AddCopy(sVpoint);
}
}
The method AddViewPointToAnimation() are called many times, with different viewpoints. At last the CreateAnimation() is called.
When I run this in my plugin, the result is like this:
But I want the viewpoints to be part of an animation, like this:
Is this possible to do with either the .NET API or the COM API.
I have tried using SavedViewpointAnimation and SavedViewpointAnimationCut to solve it, but can't figure out how to use these.