BasicDim.lsp: Automate basic dimensioning for standard drawing objects.


The free autoLisp file BasicDim.lsp is designed to automate adding basic dimensions to drawings in AutoCAD. Let’s break down how it works:

  1. Command Definition: The function c:BasicDim defines a new command for AutoCAD called BasicDim. This means you can type BasicDim in AutoCAD’s command line to run the script.
  2. Selecting Objects: The script starts by asking you to select objects to dimension. It uses the ssget function to get the selected set of objects.
  3. Looping through Objects: Once you select the objects, the script goes through each object one by one:
    • Getting the Entity: It uses ssname to get the current object (or “entity”) from the set.
    • Checking the Type: The script then checks what kind of object it is. This is done by looking at the “type” attribute of the object, such as “LINE”, “ARC”, or “CIRCLE”.
    • Adding a Dimension:
      • Lines: If the object is a line, the script uses the AutoCAD command DIMLINEAR to add a linear dimension to it.
      • Arcs and Circles: If the object is an arc or circle, it uses DIMANGULAR to add an angular dimension.
  4. Moving to the Next Object: After processing the current object, the script moves to the next one by incrementing its index.
  5. Completion: Once all objects are processed, the script ends gracefully by calling princ, which exits quietly.

In summary, the BasicDim.lsp script simplifies the process of adding dimensions to different types of objects in AutoCAD by automating it based on the object’s type. This helps save time and ensures consistency in your drawings.

Download the lisp file for free here

To use this Lisp script:

  1. Save the content into a file named BasicDim.lsp.
  2. Load the file into AutoCAD by typing the command APPLOAD and navigating to the file.
  3. Once loaded, you can run the command BasicDim to automate the process of adding basic dimensions to selected objects.