private void AngleDimension ()
{
Inventor.AssemblyDocument oDoc = (Inventor.AssemblyDocument) oApp.ActiveDocument;
Inventor.AssemblyComponentDefinition oCD = oDoc.ComponentDefinition;
Inventor.ComponentOccurrences oOcc = oCD.Occurrences;
Inventor.UnitVector vectorAxisX = oCD.WorkAxes[1].Line.Direction;
Inventor.UnitVector vectorAxisY = oCD.WorkAxes[2].Line.Direction;
Inventor.UnitVector vectorAxisZ = oCD.WorkAxes[3].Line.Direction;
Debug.WriteLine($"vectorAxisX -> ({vectorAxisX.X},{vectorAxisX.Y},{vectorAxisX.Z})");
Debug.WriteLine($"vectorAxisY -> ({vectorAxisY.X},{vectorAxisY.Y},{vectorAxisY.Z})");
Debug.WriteLine($"vectorAxisZ -> ({vectorAxisZ.X},{vectorAxisZ.Y},{vectorAxisZ.Z})");
Debug.WriteLine(vectorAxisX.AngleTo(vectorAxisX) / Math.PI * 180);
Debug.WriteLine(vectorAxisY.AngleTo(vectorAxisX) / Math.PI * 180);
Debug.WriteLine(vectorAxisZ.AngleTo(vectorAxisX) / Math.PI * 180);
// вывод
// vectorAxisX-> (1, 0, 0)
// vectorAxisY-> (0, 1, 1)
// vectorAxisZ-> (0, 0, 0)
// 0
// 90
// 90
Inventor.PartDocument oDocPart = (Inventor.PartDocument) oOcc[1].Definition.Document;
Inventor.PartComponentDefinition oCDPart = oDocPart.ComponentDefinition;
object objectProxyX;
object objectProxyY;
object objectProxyZ;
oOcc[1].CreateGeometryProxy(oCDPart.WorkAxes[1], out objectProxyX);
oOcc[1].CreateGeometryProxy(oCDPart.WorkAxes[2], out objectProxyY);
oOcc[1].CreateGeometryProxy(oCDPart.WorkAxes[3], out objectProxyZ);
Inventor.WorkAxisProxy waProxyX = (Inventor.WorkAxisProxy) objectProxyX;
Inventor.WorkAxisProxy waProxyY = (Inventor.WorkAxisProxy) objectProxyY;
Inventor.WorkAxisProxy waProxyZ = (Inventor.WorkAxisProxy) objectProxyZ;
Inventor.UnitVector vectorPartAxisX = waProxyX.Line.Direction;
Inventor.UnitVector vectorPartAxisY = waProxyY.Line.Direction;
Inventor.UnitVector vectorPartAxisZ = waProxyZ.Line.Direction;
Debug.WriteLine($"vectorPartAxisX -> ({vectorPartAxisX.X},{vectorPartAxisX.Y},{vectorPartAxisX.Z})");
Debug.WriteLine($"vectorPartAxisY -> ({vectorPartAxisY.X},{vectorPartAxisY.Y},{vectorPartAxisY.Z})");
Debug.WriteLine($"vectorPartAxisZ -> ({vectorPartAxisZ.X},{vectorPartAxisZ.Y},{vectorPartAxisZ.Z})");
Debug.WriteLine(vectorAxisX.AngleTo(vectorPartAxisX) / Math.PI * 180);
Debug.WriteLine(vectorAxisY.AngleTo(vectorPartAxisY) / Math.PI * 180);
Debug.WriteLine(vectorAxisZ.AngleTo(vectorPartAxisZ) / Math.PI * 180);
// вывод
// vectorPartAxisX-> (0, 404627124949114, -0, 427431037410317, -0, 808442699276674)
// vectorPartAxisY-> (0, 749683078886145, 0, 66130241463931, 0, 0255811966883751)
// vectorPartAxisZ-> (0, 523690911690478, -0, 616426657965536, 0, 588018710894676)
// 66,1322370155468
// 48,6007218681886
// 53,9834643828388
}