Point2D Object

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

Description

Transient 2D point. A transient point is not displayed or saved in a document. Transient 2D points are used as a wrapper to work with raw 2D point information. They are created statically using the create methods of the Point2D class.

Methods

Name Description
asArray Get coordinate data of the point
asVector Defines a vector using the coordinates of the point.
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 and returns a copy of this point object.
create Creates a transient 2D point object.
distanceTo Returns the distance from this point to another point.
getData Gets the data defining the point.
isEqualTo Checks to see if this point and another point are equal (have identical coordinates). The comparison is done within the modeling tolerance which can be found with the Application.pointTolerance property. If you want to compare two points with any other tolerance you can use the isEqualToByTolerance method.
isEqualToByTolerance Checks to see if this point and another point are equal within the specified tolerance.
set Sets the coordinates of the point by specifying the x, y coordinates.
setWithArray Sets the coordinates of the point using an array as input.
transformBy Transforms the point using the provided matrix.
translateBy Translates the point using the provided vector.
vectorTo Returns a vector from this point to another point.

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.
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 Gets and sets the X coordinate of the point.
y Gets and sets the Y coordinate of the point.

Accessed From

Arc2D.center, Arc2D.endPoint, Arc2D.getData, Arc2D.startPoint, BoundingBox2D.maxPoint, BoundingBox2D.minPoint, Circle2D.center, Circle2D.getData, CurveEvaluator2D.getEndPoints, CurveEvaluator2D.getPointAtParameter, CustomGraphicsViewPlacement.viewPoint, DXF2DImportOptions.position, Ellipse2D.center, Ellipse2D.getData, EllipticalArc2D.center, EllipticalArc2D.endPoint, EllipticalArc2D.getData, EllipticalArc2D.startPoint, Line2D.endPoint, Line2D.getData, Line2D.startPoint, Matrix2D.getAsCoordinateSystem, MouseEventArgs.position, MouseEventArgs.viewportPosition, NurbsCurve2D.controlPoints, Point2D.copy, Point2D.create, Polyline2D.points, SurfaceEvaluator.getParameterAtPoint, TriangleMesh.textureCoordinates, Vector2D.asPoint, Viewport.modelToViewSpace, Viewport.screenToView, Viewport.viewToScreen

Version

Introduced in version August 2014