By Adam Nagy
I'm adding several models to the main model using Autodesk.Navisworks.Api.Application.MainDocument.AppendFile().
Now I would like to find the partition of a specific model and transform a node in it. I searched the attributes of the node but it did not contain any InwOaTransform. How can I add a transform attribute?
Attribute transforms are only applied during model creation - apart from "File Units and Transform" that can also happen after model creation (this adds an InwOaTransform to the Partition.Attributes collection). Attribute transforms are the only transforms that can be applied during model creation.
Post model creation
The only way to apply additional transforms after model creation is via overrides. Either using the API or the GUI.
At the moment using the API you can only set/reset the transform override but cannot access its current value.
Since you are using the .NET API, you might as well iterate through the Model's instead of the InwOaPartition's and then find the specific ModelItem you need. Then you can create a COM selection from that and use OverrideTransform to transform the specific node.
Here is a plugin's code as a sample:
public override int Execute(params string parameters)
// If no models are in the document yet, then add two
Document doc = Autodesk.Navisworks.Api.Application.MainDocument;
if (doc.Models.Count < 1)
// In the first one get the ModelItem whose transform we
// want to override - e.g. the root
// Each Model has the FileName property, so you can check
// if it is the one you need
ModelItemCollection coll = new ModelItemCollection();
// Get its COM equivalent
ComApi.InwOpState10 state =
ComApi.InwOpSelection selection =
// Set the transformation override
ComApi.InwLTransform3f2 t =
ComApi.nwEObjectType.eObjectType_nwLTransform3f, null, null
double mx =
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
30, 0, 0, 1