Noel,
Your problem is in the safearray.
You are trying to fill a one dimension safearray with a list of list.
You would be much better simply entmaking the polyline.
Safearray are a pity, slow and awkward.
(defun C:BL (/ );P1 P2 P3 P4 P5 P6 P7 ptlist mspace)
(setq OSPM (getvar "osmode"))
(setvar "OSMODE" 0)
(setvar "cmdecho" 0)
(setq P1 (getpoint "\nEnter 1st point of break line: "))
;(Error_New)
(setq P2 (getpoint P1 "\nEnter 2nd point of break line: "))
;(Error_New)
(setq D (getdist P2 "\nEnter zig-zag length rel to p2: "))
;(Error_New)
(setq AN (angle P1 P2)) ;direction of line
(setq L (/ (distance P1 P2) 2)) ;dist/2
(setq C (/ D 2)) ;zig-zag/2
(setq L (- L C)) ;l-c
(setq P3 (polar P1 AN L))
(setq P6 (polar P3 AN D))
(setq P7 (polar P3 AN C))
(setq P4 (polar P7 (+ AN (DTR 90)) D))
(setq P5 (polar P7 (- AN (DTR 90)) D))
(mk_lwp (list P1 P3 P4 P5 P6 P2))
(setvar "osmode" OSPM)
)
;;******************************************************************************;
;; mk_lwp by Alan J Thompson ;
;; Argument: pl, A list of points (2d or 3d) ;
;; Create an LWPolyline at Elevation 0, on Current Layer. ;
;; Return: ename of lwpolyline ;
;;******************************************************************************;
(defun mk_lwp (pl)
(entmakex
(append (list '(0 . "LWPOLYLINE")
'(100 . "AcDbEntity")
'(100 . "AcDbPolyline")
(cons 90 (length pl))
'(70 . 0)
)
(mapcar '(lambda (p) (cons 10 (trans (list (car p) (cadr p)) 1 0))) pl)
)
)
)
I had to comment out (error_new) as you did not provide it.
ymg