Vector3D Object

Derived from: Base Object
Defined in namespace "adsk::core" and the header file is <Core/Geometry/Vector3D.h>

Description

Transient 3D vector. This object is a wrapper over 3D vector data and is used as way to pass vector data in and out of the API and as a convenience when operating on vector data. They are created statically using the create method of the Vector3D class.

Methods

Name Description
add Adds a vector to this vector.
angleTo Determines the angle between this vector and the specified vector.
asArray Returns the vector coordinates as an array [x, y, z].
asPoint Returns a new point with the same coordinate values as this vector.
classType Static function that all classes support that returns the type of the class as a string. The returned string matches the string returned by the objectType property. For example if you have a reference to an object and you want to check if it's a SketchLine you can use myObject.objectType == fusion.SketchLine.classType().
copy Creates a copy of this vector.
create Creates a 3D vector object. This object is created statically using the Vector3D.create method.
crossProduct Returns the cross product between this vector and the specified vector.
dotProduct Returns the dot product between this vector and the specified vector.
isEqualTo Determines if this vector is equal to the specified vector.
isParallelTo Determines if the input vector is parallel with this vector.
isPerpendicularTo Determines if the input vector is perpendicular to this vector.
normalize Makes this vector of unit length. This vector should not be zero length.
scaleBy Scale this vector by the specified product.
setWithArray Reset this vector with the coordinate values in an array [x, y, z].
subtract Subtract a vector from this vector.
transformBy Transform this vector by the specified matrix.

Properties

Name Description
isValid Indicates if this object is still valid, i.e. hasn't been deleted or some other action done to invalidate the reference.
length Get the length of this vector.
objectType This property is supported by all objects in the API and returns a string that contains the full name (namespace::objecttype) describing the type of the object.

It's often useful to use this in combination with the classType method to see if an object is a certain type. For example: if obj.objectType == adsk.core.Point3D.classType():
x The x value.
y The y value.
z The z value.

Accessed From

AngleValueCommandInput.manipulatorXDirection, AngleValueCommandInput.manipulatorYDirection, Arc3D.getData, Arc3D.normal, Arc3D.referenceVector, AreaProperties.getPrincipalAxes, BallJointMotion.pitchDirectionVector, BallJointMotion.rollDirectionVector, BallJointMotion.yawDirectionVector, BossFeature.direction, Camera.upVector, Circle3D.getData, Circle3D.normal, Cone.axis, Cone.getData, CurveEvaluator3D.getCurvature, CurveEvaluator3D.getFirstDerivative, CurveEvaluator3D.getSecondDerivative, CurveEvaluator3D.getTangent, CurveEvaluator3D.getThirdDerivative, CustomGraphicsBillBoard.axis, Cylinder.axis, Cylinder.getData, CylindricalJointMotion.rotationAxisVector, DirectionCommandInput.manipulatorDirection, DistanceValueCommandInput.manipulatorDirection, Ellipse3D.getData, Ellipse3D.majorAxis, Ellipse3D.normal, EllipticalArc3D.getData, EllipticalArc3D.majorAxis, EllipticalArc3D.normal, EllipticalCone.getAxes, EllipticalCone.getData, EllipticalCylinder.axis, EllipticalCylinder.getData, EllipticalCylinder.majorAxis, HoleFeature.direction, InfiniteLine3D.direction, InfiniteLine3D.getData, JointGeometry.primaryAxisVector, JointGeometry.secondaryAxisVector, JointGeometry.thirdAxisVector, JointOrigin.primaryAxisVector, JointOrigin.secondaryAxisVector, JointOrigin.thirdAxisVector, JointOriginInput.primaryAxisVector, JointOriginInput.secondaryAxisVector, JointOriginInput.thirdAxisVector, LinearMachineAxis.direction, LinearMachineAxisInput.direction, Matrix3D.getAsCoordinateSystem, Matrix3D.translation, OrientedBoundingBox3D.heightDirection, OrientedBoundingBox3D.lengthDirection, OrientedBoundingBox3D.widthDirection, PhysicalProperties.getPrincipalAxes, PinSlotJointMotion.rotationAxisVector, PinSlotJointMotion.slideDirectionVector, PlanarJointMotion.normalDirectionVector, PlanarJointMotion.primarySlideDirectionVector, PlanarJointMotion.secondarySlideDirectionVector, Plane.normal, Plane.uDirection, Plane.vDirection, Point3D.asVector, Point3D.vectorTo, PolygonMesh.normalVectors, RecognizedHole.axis, RecognizedHoleSegment.axis, RectangularPatternFeature.directionOne, RectangularPatternFeature.directionTwo, RectangularPatternFeatureInput.directionOne, RectangularPatternFeatureInput.directionTwo, RevoluteJointMotion.rotationAxisVector, Sketch.xDirection, Sketch.yDirection, SketchEllipse.majorAxis, SketchEllipticalArc.majorAxis, SliderJointMotion.slideDirectionVector, SurfaceEvaluator.getCurvature, SurfaceEvaluator.getFirstDerivative, SurfaceEvaluator.getNormalAtParameter, SurfaceEvaluator.getNormalAtPoint, SurfaceEvaluator.getSecondDerivative, SurfaceEvaluator.getThirdDerivative, ToEntityExtentDefinition.directionHint, Torus.axis, Torus.getData, TriangleMesh.normalVectors, Vector3D.copy, Vector3D.create, Vector3D.crossProduct, Viewport.frontEyeDirection, Viewport.frontUpDirection

Samples

Name Description
moveFeatures.add Demonstrates the moveFeatures.add method.

Version

Introduced in version August 2014