Hi!
I'm trying to transform a ModelItemCollection using translation and rotation with the OverridePermanentTransform function i C#. I have accomplished
to translate the item, but I can't figure out how to rotate the item around it's own axis. I also have problems rotating and translating at the same time. When I try to do that, it only rotates around global coord. Se code blow. Anyone knows how to do this uding either .NET or COM API?
I have used this example http://adndevblog.typepad.com/aec/2013/05/navisworks-2014-api-new-feature-override-transformation.ht... by Xiaodong Liang.
**** CODE ****
protected Document doc = Autodesk.Navisworks.Api.Application.MainDocument;
public ModelItemCollection Model;
//The Model is passed into the constructor. So you do not need to worry about init it.
public void MoveValidationObject(Vector3D newDirection, Rotation newRotation)
{
if (Model.Count == 0)
throw new Exception();
Transform3D oNewOverrideTrans = new Transform3D(new Rotation3D(newRotation, newDirection);
doc.Models.OverridePermanentTransform(Model, oNewOverrideTrans, true);
}
//This method only does a rotation. Why? It doesn't do any translation.
AND then the Rotation problem. How can I use Rotation3D to make a object to use in a method like the one above, to rotate around the models own local axis.