Here is some very old code
(defun c:cent (/ obj rgn pt)
(if
(and
(setq obj (car (entsel "\nSelect object to calculate centroid: ")))
(setq spc (vlax-ename->vla-object (cdr (assoc 330 (entget obj)))))
(setq obj (vlax-ename->vla-object obj))
(= 'list (type (setq rgn (vl-catch-all-apply 'vlax-invoke (list spc 'addregion (list obj))))))
)
(progn (setq pt (vlax-get (setq rgn (car rgn)) 'centroid))
(vl-catch-all-apply 'vla-delete (list rgn))
(entmake (list '(0 . "POINT") (cons 10 pt) '(8 . "centroid")))
)
)
(princ)
)