@ScottMC
I don't see the purpose of why you are cutting the circle, printing the coordinates to the command line, then pasting the circle in the same loop?
- You don't need to initialize the pp variable as ""
- There is not apparent reason to cut and paste the circle.
- You do not need to put a Global variable into the registry to recall it again in the same session, even if the program stops.
Try out the following code:
(defun c:C2 (/ cr el *error* fp oe os p p2)
(defun *error* (msg)
(if oe (setvar "cmdecho" oe))
(if os (setvar "osmode" os))
(vla-endundomark (vla-get-activedocument (vlax-get-acad-object)))
(princ (strcat "\n" msg))
)
(vla-startundomark (vla-get-activedocument (vlax-get-acad-object)))
(setq oe (getvar "cmdecho")
os (getvar "osmode")
)
(setvar "cmdecho" 0)
(while (and
(setvar 'osmode (boole 7 os 512))
(setq fp (getpoint "\nSpecify 1st Point of 2P.Circle: "))
)
(command "._Circle" "_2P" "_non" fp)
(setvar "osmode" OS)
(princ "\nSecond Point: ")
(while (= (logand (getvar "cmdactive") 1) 1)
(command pause)
)
(setq el (entget (entlast))
p (trans (cdr (assoc 10 el)) (cdr (assoc 210 el)) 1)
p2 (getvar "lastpoint")
cr (getvar "circlerad")
)
(princ
(strcat
"\n Coordinates: "
(setq C2:pp ;; Global Variable "C2:pp"
(strcat
(rtos (car p) 2 4) ","
(rtos (cadr p) 2 4) ","
(rtos (caddr p) 2 4)
)
)
"\n Diameter: "
(rtos (* cr 2) 2 4)
"| Radius: "
(rtos cr 2 4)
"\n"
)
)
(entmakex (list (cons 0 "POINT") (cons 10 p)))
(entmakex (list (cons 0 "POINT") (cons 10 p2)))
)
(setvar "cmdecho" oe)
(vla-endundomark (vla-get-activedocument (vlax-get-acad-object)))
(princ)
)