Wednesday, February 18, 2026

FREE LISP : Draw Stair Number

Auto Numbering Along a Line in PTCAD (Using LISP)

When working with drawings such as layout grids, parking numbers, seat numbers, column numbering, or coordinate markers, we often need to place numbers evenly spaced along a straight line. Doing this manually can be slow and error-prone.

This simple LISP routine helps automate the process.

What This LISP Does

The command allows the user to:

  1. Specify the number of texts

  2. Define the starting number

  3. Set the text height

  4. Pick a start point and end point

The program will then:

  • Place the first number at the start point

  • Place the last number at the end point

  • Automatically divide the space evenly

  • Insert all numbers in sequence

Example result:

1 ---- 2 ---- 3 ---- 4 ---- 5

All numbers are spaced equally along the selected line.

Why This Is Useful

This tool is especially helpful for tasks such as:

  • Column numbering in structural drawings

  • Parking lot numbering

  • Seat numbering in halls or stadiums

  • Grid labeling

  • Survey or coordinate markers

  • Repetitive annotation tasks

Instead of calculating spacing manually, the LISP automatically divides the distance and places the numbers correctly.

Tips for Best Use

Use Object Snap (OSNAP)
Snap precisely to the intended start and end points.

Use appropriate text height
Choose a height that matches the drawing scale.

Plan the numbering direction
Numbers will increase from the first picked point toward the second point.

Use it with construction lines
You can draw a temporary line as a guide and erase it afterward.

Works in all CAD version support LISP
Because the routine uses standard LISP (no Visual LISP functions).

Productivity Benefit

For example:

Manual work

Place text → copy → move → edit numbers → repeat

Using this LISP

Pick start → pick end → done

                 What might take 2–3 minutes manually can be done in just a few seconds.


Here is VDO Link

https://www.tiktok.com/@ptcaduser/video/7613673564130086160?is_from_webapp=1&sender_device=pc&web_id=7486330426983859719


Below is source code.

Command to run  is NLL


(defun c:NLL (/ p1 p2 n startnum hgt i dx dy px py)
  (setq n (getint "\nNumber of texts: "))
  (setq startnum (getint "\nStarting number: "))
  (setq hgt (getreal "\nText height: "))
  (setq p1 (getpoint "\nPick start point of line: "))
  (setq p2 (getpoint p1 "\nPick end point of line: "))
  (setq dx (/ (- (car p2) (car p1)) (- n 1)))
  (setq dy (/ (- (cadr p2) (cadr p1)) (- n 1)))
  (setq i 0)
  (while (< i n)
    (setq px (+ (car p1) (* i dx)))
    (setq py (+ (cadr p1) (* i dy)))
    (command "TEXT" (list px py) hgt "0" (itoa (+ startnum i)))
    (setq i (+ i 1))
  )
  (princ)
)




FREE LISP : Draw Stair Number

Auto Numbering Along a Line in PTCAD (Using LISP) When working with drawings such as layout grids, parking numbers, seat numbers, column num...