I have an example:
[red_line.tar.gz](https://github.com/LibreDWG/libredwg/files/14498409/red_line.tar.gz)

Intention: Create a line, change color to red, create ltype, and use it in the created line.

I am curious, that in the DWG file isn't set ltype in the LINE entity.

What am I doing wrong?

```c
	ltype = dwg_add_LTYPE(dwg, "New LTYPE");

	line = dwg_add_LINE(hdr, &pt1, &pt2);
	if (line != NULL) {
		// Red color.
		line->parent->color.index = 1; // Red color

		// Set line type.
		ltype_obj = dwg_obj_generic_to_object (ltype, &ret);
		line->parent->ltype = dwg_add_handleref (dwg, 5, ltype_obj->handle.value, NULL);
	}
```
How to set linetype to entity?
This is a GitHub Issue
repo:libredwg
owner:LibreDWG
Title : How to set linetype to entity?
Issue date:

--- start body ---
I have an example:
[red_line.tar.gz](https://github.com/LibreDWG/libredwg/files/14498409/red_line.tar.gz)

Intention: Create a line, change color to red, create ltype, and use it in the created line.

I am curious, that in the DWG file isn't set ltype in the LINE entity.

What am I doing wrong?

```c
	ltype = dwg_add_LTYPE(dwg, "New LTYPE");

	line = dwg_add_LINE(hdr, &pt1, &pt2);
	if (line != NULL) {
		// Red color.
		line->parent->color.index = 1; // Red color

		// Set line type.
		ltype_obj = dwg_obj_generic_to_object (ltype, &ret);
		line->parent->ltype = dwg_add_handleref (dwg, 5, ltype_obj->handle.value, NULL);
	}
```
--- end body ---

None