Attached is an updated lisp.
This lisp will handle all cases - drawing units in metres or millimetres and distances in metres or millimetres.
I have carried out minimal testing with the lisp.
I have incorporated a local error routine.
I have incorporated using a dynamic prompt (if you aren't using it). This displays the choices to the two questions at the cursor as well as the command line, and resets at the end.
This asks for
1. the number of drawing units in 1 metre
2. whether you want the distances shown in millimeres or metres
To make this clear the "distancia" column will now show "distancia (mm)" or "distancia (m)"
I have adjusted the decimal places shown when converting from millimetre drawing units to metre lengths to 3 decimal places. This is automatic depending on what you select.
I have shifted the "release objects" code to it's own sub routine, allowing it to be called twice; once if it ends successfully and again if there is an error.
I have shifted out the collection of layer properties to it's own sub routine
MedZ v5.lsp
Hi there!
Between the (vl-load-com) and the (princ) lines (at the end), add these 2 lines
(command "_.rectang" "0,0" "R" "0" "1,1")
(entdel (entlast))
it will leave the rotation of rectangle at 0 after execution.
If this solves your problem, please mark this reply accordingly. Thanks and cheers.