I agree with Mr. Madsen, that's an excellent start Danny, you're just missing a few bits.
What might help is if you observe the data for an entity that already exists.
Make a line the normal way, that is by typing the line command at the AutoCAD command line. When prompted for the endpoints perhaps key in the coordinates instead of picking them with the mouse (entering coordinates easy to remember).
Then load and run this code little program, selecting the line you just made when prompted.
(defun c:ListData ( / myprinc ename )
(defun myprinc (tabs x)
(repeat tabs (princ " "))
(princ x)
(princ "\n")
)
(cond
( (setq ename (car (entsel)))
(myprinc 0 (strcat "\n" (chr 40)))
(foreach x (entget ename)
(myprinc 1 x)
)
(myprinc 0 (chr 41))
)
)
(princ)
)
You should see something like this:
(
(-1 . <Entity name: 7ef54e88>)
(0 . LINE)
(330 . <Entity name: 7ef54cf8>)
(5 . 89)
(100 . AcDbEntity)
(67 . 0)
(410 . Model)
(8 . 0)
(100 . AcDbLine)
(10 10.0 10.0 0.0)
(11 20.0 20.0 0.0)
(210 0.0 0.0 1.0)
)
What do you notice? Do you see the endpoints you specified?
Some of the data you'll see is not requred to entmake a line, but would be a result of an entmake request; group codes like the
-1, 330 and
5 (which you will come to know in time so don't sweat them for now).
Other group codes are the result of default values, that is, you can specifiy their values but if you don't default values are assumeed; group codes like
67, 410, 8 and
210.
So ... what is left?
Hope this helps a little.
Cheers, Michael.