• 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

ROT2ENT LISP: Rotate Objects to Match Another Angle

September 19, 2020

Last updated July 28, 2026

Rot2ent rotates objects so that one edge of them lines up with another object. Instead of working out an angle and typing it, you show it which line on your selection should match which line elsewhere, and it does the arithmetic.

It is by TimeSavers for CAD, copyright 2001.

The listing has the wrong name on it

Worth clearing up first. The download table below is headed “Roof Pitch”, which is a different routine entirely — there is a genuine roof pitch routine on this site and it is not this one. The name has been attached to the wrong entry at some point.

The description in the same table is correct: this rotates objects to match an angle. Nothing in the download has anything to do with roofs.

Why matching beats measuring

The usual way to rotate something into alignment is to measure the target angle, then rotate by the difference. That is two operations and an opportunity to get a sign wrong, and it goes badly when the target is not at a round angle.

This asks a different question. You nominate a straight edge on the thing being rotated — the routine calls it the rotation baseline — and then a line whose angle you want that baseline to end up at. The rotation needed is the difference between the two, computed rather than measured.

The sequence documented in the file is five steps: select the objects to rotate, select the baseline on them, select the line whose angle to match, pick the base point for the rotation, then settle the final position. That last step lets you flip the result if the match came out end-for-end, which is the usual thing that goes wrong with an alignment.

It is well built

Worth noting after a long run of 1980s and 1990s files. This one declares a full list of local variables and defines its own error handler under a distinctive name rather than clobbering the general one — the mark of somebody who expected the routine to live alongside other people’s code.

It also appears inside the Best of LISP collection on this site, which is a reasonable indication that other people rated it too.

Command reference

The file defines a single command, ROT2ENT — rotate to entity.

If you also load the Best of LISP collection you will have two copies of it. That is harmless, since they are the same routine, but worth knowing so a duplicate does not look like a problem.

How to load it

Unzip Rot2ent.zip and load Rot2ent.lsp with APPLOAD, or add it to the Startup Suite. No support files. Our AutoLISP guide covers loading.

Step-by-step usage

  1. Type ROT2ENT and select the objects you want rotated.
  2. Select the straight segment on those objects that should take on the new angle.
  3. Select the line whose angle you want to match.
  4. Pick the base point the rotation should turn about.
  5. Settle the final orientation.

The baseline you nominate has to be a straight segment. On a shape made of arcs and curves, draw a temporary line along the edge you care about, use that, then erase it.

Compatibility notes

2001, which makes it one of the newer files in this library, and the quality of the code suggests it was meant to last. It does angle arithmetic and drives the ROTATE command, neither of which has changed.

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, should be able to run it. See what runs on AutoCAD LT. It moves geometry, so try it on a copy first.

Download

Name: Roof Pitch
Description: Rotates selected objects relative to a specific
angle or to match the angle of an existing object.
Type: AutoCAD AutoLISP Routine
Author: See file
File Size: 2 Kb
Cost: Free
Worked on: AutoCAD
Download File: Rot2ent.zip

The Name row above is the mislabelling described at the top of this page. The download is Rot2ent.

Related routines

  • Best of LISP collection — includes a copy of this routine.
  • Roof Pitch — the routine the listing above confuses this with.
  • TTT — another construction that saves you working out geometry by hand.

References

  • AutoLISP: the complete guide
  • Free LISP routines library
  • 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