Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rotate modelItemCollection using Rotation3D and OverridePermanentTransform

0 REPLIES 0
Reply
Message 1 of 1
mariuroe
1183 Views, 0 Replies

Rotate modelItemCollection using Rotation3D and OverridePermanentTransform

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.



0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report