CADLisp Tools

Geometry & Polylines

Bearing Between Points AutoLISP routine

Report clockwise azimuth from north between two picked points. Download the .LSP source below and run the PTBEARING command after loading it.

⌘ PTBEARINGv1.0.0IntermediateUpdated Sep 18, 2026

What it does

Bearing Between Points with the PTBEARING AutoLISP command

Converts the planar angle between two points into a 0–360 degree azimuth measured clockwise from north.

AutoLISP command
PTBEARING
Difficulty
Intermediate

Applicable disciplines

CAD workflows that use this routine

Requirements and compatibility

What it needs

AutoLISP

Software rows marked “Not tested” are not compatibility claims. Test the routine in a copy of your drawing and CAD version.

Downloadable source code

Review the bearing-between-points.lsp AutoLISP code

bearing-between-points.lspAUTOLISP
;; CADLisp Tools - Bearing Between Points
(defun c:PTBEARING (/ p1 p2 degrees azimuth)
  (if (and (setq p1 (getpoint "\nOccupied point: ")) (setq p2 (getpoint p1 "\nTarget point: ")) (/= (distance p1 p2) 0.0))
    (progn
      (setq degrees (* 180.0 (/ (angle p1 p2) pi)) azimuth (- 90.0 degrees))
      (if (< azimuth 0.0) (setq azimuth (+ azimuth 360.0)))
      (prompt (strcat "\nAzimuth clockwise from north: " (rtos azimuth 2 4) " degrees")))
    (prompt "\nTwo different points are required."))
  (princ))

Setup

How to install the bearing-between-points.lsp file

  1. 1Download and review the source code.
  2. 2Load the .lsp file with APPLOAD in a copy of a drawing.
  3. 3Keep the routine session-only until it has been tested for your CAD version and standards.

Command workflow

How to run the PTBEARING command

  1. 1Run PTBEARING.
  2. 2Pick the occupied point.
  3. 3Pick the target point and read the azimuth.

Worked example

Example: Find the azimuth of a line between survey points.

  1. Run PTBEARING.
  2. Pick start then end.
Expected result

A decimal-degree azimuth clockwise from north is printed.

Read before use

Notes and limitations

  • Reports decimal-degree azimuth, not quadrant bearing.
  • Uses the current UCS XY plane.
  • Not manually CAD-tested.

Version history

Changelog

v1.0.0Sep 18, 2026Initial north-azimuth routine.

Keep automating

Related tools

Dimensions & Annotation6 disciplines

Coordinate Label X/Y

Create a WCS X/Y text label at a picked coordinate.

⌘ XYLABELBeginnerCAD support: not tested
Updated Sep 18, 2026VIEW TOOL →
Geometry & Polylines6 disciplines

Distance Between Points

Report the 2D and 3D distance between two picked points.

⌘ PTDISTBeginnerCAD support: not tested
Updated Sep 18, 2026VIEW TOOL →
Geometry & Polylines4 disciplines

Station/Chainage Along Polyline

Report distance along a selected polyline to a picked location.

⌘ CHAINAGEIntermediateCAD support: not tested
Updated Sep 18, 2026VIEW TOOL →