|
![]() |
Represents a direction with magnitude in 3D space. Immutable.
Namespace: Autodesk.Navisworks.Api
Assembly: Autodesk.Navisworks.Api (in Autodesk.Navisworks.Api.dll)
Syntax
Visual Basic |
---|
Public Class Vector3D _ Inherits NativeHandle |
C# |
---|
public class Vector3D : NativeHandle |
Visual C++ |
---|
public ref class Vector3D : public NativeHandle |
Remarks
Vector3D objects appear in various areas of the API.
This class represents a geometrical vector. A vector is what is needed to translate from point A to point B.
Examples

using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Windows.Forms; using System.Text; using Autodesk.Navisworks.Api.Controls; static public Vector3D GetVectorToSelection() { Vector3D vector = null; //check that selection is valid if (!Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentSelection.IsEmpty) { //Get bounding box of the selection BoundingBox3D bb3d = Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentSelection.SelectedItems.BoundingBox(); //get the centre point Point3D centreOfBox = bb3d.Center; //set the vector to the centre vector = centreOfBox.ToVector3D(); } //return the vector return vector; }