# RAY in AutoCAD

> How AutoCAD's RAY command draws construction lines that start at a point and run to infinity one way, and how they trim into lines. Try it free.

RAY draws rays: construction lines that start at a point and run to infinity in one direction. Pick the start point, then a through point: the ray starts at the first and passes through the second. Every further point makes another ray from the same start, until Enter ends the command. A through point on the start is refused with `*Invalid*`. Each ray is on the current layer with the current colour, linetype and lineweight.

A ray runs across the view however far you pan or zoom, and the drawing's extents leave it out, as in AutoCAD. The Endpoint snap finds its start, Nearest, Perpendicular and Intersection work along it. [`TRIM`](https://mellowcad.com/docs/commands/trim.md) and [`BREAK`](https://mellowcad.com/docs/commands/break.md) turn the stretch that holds the start into a line, and [`EXTEND`](https://mellowcad.com/docs/commands/extend.md) runs the start back to an edge behind it. [`XLINE`](https://mellowcad.com/docs/commands/xline.md) draws lines that run both ways.

- **Command:** `RAY`
- **Panel:** [Draw](https://mellowcad.com/docs/commands.md#draw)
- **Try it:** [Open the editor](/draw), type `RAY` and press Enter.

## At the command line

The engine draws it and writes its history as you would type it: the prompts in AutoCAD 2027's order, with the same option letters.

Rays from one start point through three points, each running on past the edge of the view.

```text
Command: RAY
Specify start point: 20,20
Specify through point: @40,10
Specify through point: @30,30
Specify through point: @0,40
Specify through point:
```

## What it does not do yet

LENGTHEN and JOIN of a ray are not checked against AutoCAD yet, nor the menus of its grips.

[What it does and still lacks, in detail (in English)](https://github.com/ovelilla/mellowcad/blob/main/docs/coverage/draw.md#ray--es-rayo--pt-br-raio--fr-demidroite--it-raggio--de-strahl--ru-луч--pl-półprosta--cs-polopřímka--hu-sugár)

## Questions

### What is the RAY command in AutoCAD?

A construction line with a start: it begins at a point and runs on forever in one direction. Use it as a reference to draw against, then trim it into a line or erase it.

### Does RAY have a shortcut?

No: AutoCAD gives RAY no alias, so type `RAY` in full. It is in the expanded Draw panel of the ribbon, and here in the Draw tools beside Construction Line.

### How do I make a ray stop at a line?

Trim it: run [`TRIM`](https://mellowcad.com/docs/commands/trim.md) and pick the part past the line. What is left from the start to the line is a line object.

### What is the difference between a ray and a line?

A line has two ends; a ray has one, its start, and runs on without end. In a DXF file a ray is saved as a RAY, and opens as one.

## Related commands

- [XLINE in AutoCAD](https://mellowcad.com/docs/commands/xline.md)
- [LINE in AutoCAD](https://mellowcad.com/docs/commands/line.md)
- [TRIM in AutoCAD](https://mellowcad.com/docs/commands/trim.md)
- [EXTEND in AutoCAD](https://mellowcad.com/docs/commands/extend.md)
