I want to mark layers of some elements in the drawing. I thought of using MLeader for this. I wrote some code in lisp but doesn't work. What am I doing wrong here?
(defun c:ObjLayer(/ pnt1 pnt2 n obj dxf LayerName newdxf)
(setq n 1)
(while (> n 0)
(setq pnt1 (getpoint "\nPick first point:"))
(setq pnt2 (getpoint pnt1 "\nPick next point:"))
(setq obj (car (entsel "\nPick Entity:")))
(setq dxf (entget obj))
(setq LayerName (cdr (assoc 8 dxf)))
(setq newdxf '((0 . "MULTILEADER")
(cons 110 (car pnt1)(cadr pnt1)(caddr pnt1))
(cons 10 (car pnt2)(cadr pnt2)(caddr pnt2))
(cons 304 LayerName)
(cons 8 "A-ANNO-DIMS")
))
(entmake newdxf)
(setq n (1+ n))
)
)