Getting an error using the LISP file TXTBOXWIDTH.lsp

I have a LISP that I used in my old CAD program for years to Shrinkwrap the bounding box of selected MText, but when i run it in BricsCAD i get the following error

txtboxwidth
Select entities:
Entities in set: 1
Select entities:
; --- LISP : Call Stack ---
; [0]...C:TXTBOXWIDTH
; [1].....MIP-MTEXT-WRAP-BB
; [2].......SETHANDLES <<-- ; ; --- Error around expression --- ; (ASSOC 75 0) ; ; error : bad argument type <0> ; expected at [assoc]

I'll attach the LISP file, Thanks

Comments

  • Assoc expects an element in an associated list along with a list to search. the "0" in (assoc 75 0) is a number, not a list.

    On line 116 try changing
    (subst (cons 75 0) (assoc 75 0) lst)

    to
    (subst (cons 75 0) (assoc 75 lst) lst)

    Regards,
    Jason Bourhill
    BricsCAD V20 Ultimate
    CAD Concepts

  • Thanks for the help