Tuesday, December 17, 2024

FREE LISP : Numbering with Circle

 

FREE LISP: Automatic Numbering with Circle (NUMCIR)

Introduction

In professional CAD drafting—especially in architectural, structural, and engineering drawings—numbered callouts inside circles (bubble tags) are widely used. These are essential for identifying details, sections, columns, reference points, and annotations.

Manually drawing a circle and placing text for each item is repetitive, time-consuming, and prone to inconsistency. To address this, we developed an AutoLISP tool called NUMCIR, which automates the entire process.


What is NUMCIR?

NUMCIR is an LISP command that allows users to:

  • Automatically generate sequential numbers (1, 2, 3, …)

  • Place them interactively by clicking in the drawing

  • Create a circle around each number

  • Continue placing until pressing Enter to finish

This tool is ideal for creating clean and consistent callouts quickly.


How It Works

The logic behind NUMCIR is simple and efficient:

  1. Initialize a counter starting at 1

  2. Ask the user to input text height

  3. Calculate circle radius based on text height

  4. Enter a loop:

    • Wait for the user to pick a point

    • Place centered text at that point

    • Draw a circle around the text

    • Increment the number

  5. Exit when the user presses Enter

How to Use

  1. Load the LISP file using APPLOAD

  2. Type command: NUMCIR

  3. Enter desired text height

  4. Click locations in the drawing

  5. Each click creates a number inside a circle

  6. Press Enter to finish


Practical Applications

This tool is highly useful in:

  • Architectural drawings
    Detail callouts, room tags, section markers

  • Structural drawings
    Column numbering, footing references

  • MEP drawings
    Equipment tags, system references

  • Shop drawings
    Part identification and labeling


Advantages

  • ✅ Speeds up repetitive annotation tasks

  • ✅ Ensures consistent size and alignment

  • ✅ Reduces manual drafting errors


Source code

(defun c:NUMCIR ( / pt num hgt rad )
  
  (setq num 1) ; start number
  (setq hgt (getreal "\nEnter text height: "))
  (setq rad (* hgt 1.2)) ; circle radius
  
  (while (setq pt (getpoint "\nPick point to place (Enter to stop): "))
    
    ;; Create centered TEXT
    (command "TEXT" "J" "MC" pt hgt 0 (itoa num))
    
    ;; Create CIRCLE
    (command "CIRCLE" pt rad)
    
    (setq num (+ num 1))
  )
  
  (princ)
)



FREE LISP : Improving Drawing Quality by using Ortho-Check LISP

  Improving Drawing Quality with an Ortho-Check LISP Tool In many CAD workflows, especially in architectural, engineering, and construction...