I have written a program which inserts totems at 2metre or less centres and prompts the user for the position of the totems. This works perfectly if the ucs is in its normal position but if the ucs is rotated then the distances go haywire!! I measure the distance from the first insertion point to the second insertion point and a loop ensures that this distance is less than 2m and if not prompts the user for a new insertion point less than 2m away from the initial insertion point. When the ucs is rotated it gets stuck in this loop (see code below). I don't know why so any help would be greatly appreciated. Thank you Traci (defun totemline ( / ) ; draws lines between totems and posts (setq dist1 3000) (while (> dist1 2000) (Princ " Please input the next point : ")(princ) (command "_line" ins1 pause "") (setq ins3 ins1) (setq ins2 (cdr (assoc 11 (cdr (entget (entlast)))))) (command "_dist" ins1 ins2) (setq dist1 (getvar "distance")) (if (> dist1 2000) (progn (command "_erase" (entlast) "") (princ " This must be less than 2000mm")(princ) ); end progn );end if );end while ); ends totemline function