If you have any object which needs to be rotated at an unknown angle then there are a couple of ways with which you can do it.

The most obvious way is the use of reference option of Rotate command.

To explain this tip, I will use this 2D drawing of a spanner.

Image 1: Spanner and reference line

Using Reference option

Let's assume that we want to rotate the Spanner with reference to another line AB as shown in the drawing with Red colour.

Type RO and press enter to start the rotate command, select the spanner, and press enter key again. Click on any point on the spanner and that will become the base point about which the spanner will rotate.

In this case, I am selecting a random point close to the center of the spanner as the base point.

Now select Reference option from the command line as shown in the image below.

Image 2: Reference option of Rotate command

Click on the two points in the drawing that will act as the reference of rotation. In this case, I am selecting the midpoints of the filleted rectangle which act as the reference shown in the image below.

Image 3: Reference points on the spanner

Now select Points option from the command line and then click on point A and B of red line respectively. The spanner will align parallel to the line AB as shown in the image below.

Image 4: Final alignment of spanner with respect to reference line AB

There is also an alternate way of doing this with the help of ALIGN command, which I will explain next.

Rotating with reference using ALIGN

Align tool is another way of rotating an object with reference to another. I will use the same example of spanner to explain this tip.

Type AL and press enter then select the spanner and press enter again.

Now you need to specify the first point of reference. Select the midpoint 1 of the filleted rectangle which we have selected earlier as shown in the image 3.

Now click on point A on the red line and that will become the point on which midpoint 1 will be placed.

Image 5: Reference points for Align command

Once again select the midpoint 2 of the filleted rectangle which you have selected earlier and click on point B of red line as its reference.

In this case, midpoint 1 will coincide with point A, midpoint 2 will become collinear with point B and now we need to specify the third reference points.

Select any point directly above the spanner as the third base point and then click anywhere above line AB as the third reference point.

The order of selection of points in my case is shown in the image below.

Rotate one object to match another unknown angle in AutoCAD

Image 6: Order of selection of points in Align command

As soon as you click on the third reference point the spanner will align parallel to the line AB with midpoint 1 coinciding with the point A of the red line.

Do you have questions related to this tip? Let me know in the comments below.