Here are three examples demonstrating how to construct a blue circle under any UCS/View settings, using either command calls, Vanilla AutoLISP using entmake, or Visual LISP using ActiveX methods:
Command Calls:
(defun c:com-cir ( / cec cen rad )
(if
(and
(setq cen (getpoint "\nSpecify circle center: "))
(setq rad (getdist cen "\nSpecify circle radius: "))
)
(progn
(setq cec (getvar 'cecolor))
(setvar 'cecolor "5")
(command "_.circle" "_non" cen rad)
(setvar 'cecolor cec)
)
)
(princ)
)
Vanilla AutoLISP using entmake:
(defun c:al-cir ( / cen rad )
(if
(and
(setq cen (getpoint "\nSpecify circle center: "))
(setq rad (getdist cen "\nSpecify circle radius: "))
)
(entmake
(list
'(000 . "CIRCLE")
'(062 . 5)
(cons 010 (trans cen 1 (trans '(0 0 1) 1 0 t)))
(cons 040 rad)
(cons 210 (trans '(0 0 1) 1 0 t))
)
)
)
(princ)
)
Visual LISP using ActiveX:
(defun c:vl-cir ( / cen obj rad )
(if
(and
(setq cen (getpoint "\nSpecify circle center: "))
(setq rad (getdist cen "\nSpecify circle radius: "))
)
(progn
(setq obj
(vla-addcircle
(vlax-get-property
(vla-get-activedocument
(vlax-get-acad-object)
)
(if (= 1 (getvar 'cvport))
'paperspace
'modelspace
)
)
(vlax-3D-point (trans cen 1 0))
rad
)
)
(vla-put-color obj acblue)
)
)
(princ)
)
(vl-load-com) (princ)