---
title: "CadRay"
url: "https://reference.aspose.com/cad/java/com.aspose.cad.fileformats.cad.cadobjects/cadray/"
product: "Aspose.CAD for Java"
description: "Class describing CadRay"
---


**Inheritance:** java.lang.Object, CadBaseInfinityEntity

Class describing CadRay

## Constructors

| Constructor | Description |
| --- | --- |
| [CadRay(Cad3DPoint firstPoint, Cad3DPoint unitDirectionVector)](#CadRay-com.aspose.cad.fileformats.cad.cadobjects.Cad3DPoint-com.aspose.cad.fileformats.cad.cadobjects.Cad3DPoint) | Initializes a new instance of the CadRay class. |

## Methods

| Method | Description |
| --- | --- |
| [getTypeName()](#getTypeName) | Gets the name of the type. |
| [getFirstPoint()](#getFirstPoint) | Gets or sets the first point . |
| [setFirstPoint(Cad3DPoint value)](#setFirstPoint-com.aspose.cad.fileformats.cad.cadobjects.Cad3DPoint) | Gets or sets the first point . |
| [getUnitDirectionVector()](#getUnitDirectionVector) | Gets or sets the unit direction vector. |
| [setUnitDirectionVector(Cad3DPoint value)](#setUnitDirectionVector-com.aspose.cad.fileformats.cad.cadobjects.Cad3DPoint) | Gets or sets the unit direction vector. |

### CadRay(Cad3DPoint firstPoint, Cad3DPoint unitDirectionVector) {#CadRay-com.aspose.cad.fileformats.cad.cadobjects.Cad3DPoint-com.aspose.cad.fileformats.cad.cadobjects.Cad3DPoint}
```java
public CadRay(Cad3DPoint firstPoint, Cad3DPoint unitDirectionVector)
```

Initializes a new instance of the CadRay class.

**Parameters:**

| Parameter | Type | Description |
| --- | --- | --- |
| firstPoint | Cad3DPoint | First point. |
| unitDirectionVector | Cad3DPoint | Unit direction vector. |

**Throws:**

- `com.aspose.ms.System.ArgumentNullException` - Thrown when one of arguments is null

### getTypeName() {#getTypeName}
```java
public int getTypeName()
```

Gets the name of the type.

**Returns:** int - The name of the type.

### getFirstPoint() {#getFirstPoint}
```java
public Cad3DPoint getFirstPoint()
```

Gets or sets the first point .

**Returns:** Cad3DPoint - The First Point .

### setFirstPoint(Cad3DPoint value) {#setFirstPoint-com.aspose.cad.fileformats.cad.cadobjects.Cad3DPoint}
```java
public void setFirstPoint(Cad3DPoint value)
```

Gets or sets the first point .

**Parameters:**

| Parameter | Type | Description |
| --- | --- | --- |
| value | Cad3DPoint | The First Point . |

### getUnitDirectionVector() {#getUnitDirectionVector}
```java
public Cad3DPoint getUnitDirectionVector()
```

Gets or sets the unit direction vector.

**Returns:** Cad3DPoint - The unit direction vector.

### setUnitDirectionVector(Cad3DPoint value) {#setUnitDirectionVector-com.aspose.cad.fileformats.cad.cadobjects.Cad3DPoint}
```java
public void setUnitDirectionVector(Cad3DPoint value)
```

Gets or sets the unit direction vector.

**Parameters:**

| Parameter | Type | Description |
| --- | --- | --- |
| value | Cad3DPoint | The unit direction vector. |

