• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

2DDOOR LISP: Draw a Door with Trim and Knob in AutoCAD

August 1, 2006

Last updated July 28, 2026

A small routine that draws a door in plan with its trim and a knob. You give it the opening size, the trim width and the knob radius, pick the lower left corner, and it draws the lot.

It is by Reid Reagan, dated 25 January 1995 — a companion to the 2D window routine on this site, which comes from the same era and works the same way.

Check it loads before you plan around it

An honest note, and the first thing to deal with.

The line that defines the command has a space in the middle of the command name — it reads C: 2dDOOR rather than C:2DDOOR. In AutoLISP the C: prefix and the command name have to be joined into one word; that space makes them two separate things, and a function definition written that way is not valid.

We have not run the file, so we will not tell you flatly that it fails — some readers are more forgiving than others. But load it in a scratch drawing and confirm the command actually answers before you rely on it. If it does not, the fix is to delete one space.

That is worth knowing generally: a routine that appears to load without complaint but whose command is not recognised afterwards usually has something wrong with the defun line rather than with the body of the code.

What it asks for

Four dimensions and a point, in this order: the horizontal distance, the vertical distance, the trim width, and the door knob radius, then the lower left corner of the opening.

Note there are no defaults offered on any of them, unlike its window counterpart, which suggests these two were written by different hands even though they were collected together. It also saves the current layer before it starts, so it can put things back.

Expect imperial thinking in the numbers you type — this is mid-1990s American student-era work, and the window routine it pairs with offers defaults of 56 and 48, which are inches rather than millimetres.

Command reference

The command as written is 2DDOOR, subject to the caveat above about how the definition line is formed.

Note that a command name starting with a digit is legal in AutoLISP but unusual, and some people find it awkward to type. If you are editing the file to fix the space anyway, renaming it to something alphabetic costs nothing.

How to load it

Unzip 2DDOOR.zip and load 2DDOOR.LSP with APPLOAD. No support files. Our AutoLISP guide covers loading.

Step-by-step usage

  1. Load the file and confirm the command is recognised before going further.
  2. Type the command.
  3. Give the horizontal distance, then the vertical distance — the opening size.
  4. Give the trim width and the door knob radius.
  5. Pick the lower left corner of the opening. The door is drawn from there.

Draw one at a known size in a scratch drawing and dimension it before using it on a plan, so you can see how the trim width relates to the opening you nominated.

Compatibility notes

January 1995, so written-for rather than tested-on. Beyond the defun line it is straightforward point arithmetic with AutoCAD’s own drawing commands, which is the kind of code that survives.

Plain AutoLISP with no dialog boxes and no Express Tools calls, so nothing requires the full product; LT users on LT 2024 or later, the release that brought AutoLISP to LT, face the same loading question as everyone else. See what runs on AutoCAD LT.

If you want a door routine that is known to be sound, the ArchLisp collection has four covering different swing types, and there is a standalone door routine here as well.

Download

Name: 2D Door
Description: A small program that draws a 2D door on your floor plan.
Type: AutoCAD AutoLISP Routine
Author: Reid Reagan
File Size: 1 Kb
Cost: Free
Worked on: AutoCAD
Download File: 2DDOOR.zip

Related routines

  • 2D Window — its companion, collected at the same time.
  • ArchLisp — four door routines by swing type.
  • Building collection — single and double doors, plus windows.

References

  • AutoLISP: the complete guide
  • Free LISP routines library
  • AutoLISP Lesson 4: Program Format
  • AutoLISP on AutoCAD LT

Filed Under: AutoLISP Routines

Primary Sidebar

Subscribe to our Youtube Channel

Post CAD drafting jobs on Freelancer.com. and get some free money to do this.

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (30)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (29)
  • AutoCAD Tutorials (54)
  • AutoLISP Routines (328)
  • AutoLISP Tutorials (15)
  • CAD Standards (7)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (84)
  • Electrical Drafting (2)
  • General IT reference (7)
  • Geometry (15)
  • GIS (2)
  • Hatch Patterns (12)
  • Office Life Hacks (3)
  • PT (1)
  • Revit Tutorials (54)
  • Steel Detailing (14)
  • Structural Drafting (26)
  • Technical Dictionary (61)
  • Useful Website Links (19)

Footer

Free downloads

  • Free AutoLISP routines
  • Free hatch patterns
  • SHX fonts & text styles
  • Numbering LISP collection
  • ISO 3098B font

Reference charts

  • AWS weld symbols chart
  • Steel detailing chart
  • Hole & slot sizes
  • Bolt edge distance
  • ANSI & ARCH paper sizes
  • How to fold an A1 drawing

Useful links

  • CAD blocks (DWG)
  • Revit families
  • structuraldrafter.com
  • cad-corner.com
  • About
  • Privacy policy

Provided for free with no warranty · Log in