Stig, Keith found that you could set the UCS to the object by
(setq Cobj (entsel "\nPlease select Solid or Region: "))
(vl-cmdf "ucs" "object" (cadr Cobj))
So, once I had that it was relatively easy to
;;; Set Active Space
(setq Active-Doc (vla-get-activedocument (vlax-get-acad-object))
ActiveSpace (vla-get-activespace Active-Doc)
)
(if (= 1 ActiveSpace)
(setq ActiveSpace (vla-get-modelspace Active-Doc))
(setq ActiveSpace (vla-get-paperspace Active-Doc))
)
;;; End Active Space
(setq SoR (vlax-ename->vla-object (car Cobj)))
(setq SoRlay (vlax-get-property SoR 'layer))
(setq Objtype (vlax-get-property SoR 'objectname))
(setq Cent
(vlax-safearray->list
(vlax-variant-value
(vlax-get-property SoR 'Centroid)
)
)
)
(if (= Objtype "AcDbRegion")
(setq Cent (trans Cent 1 0))
)
;;; Set the Point size
(setvar "pdsize" (getvar "dimasz"))
(setvar "pdmode" 35)
;;; add the point
(setq CPnt (vla-addpoint ActiveSpace (vlax-3d-point cent)))
(vlax-put-property CPnt 'layer Sorlay)
and by saving the current UCS before running & restoring/deleting it as per your routine, the problem was solved.
The only thing I found was that setting the UCS to a solid always returned the correct coordinates, but a region's coordinates had to be translated.
I need to add error checking and something to disallow the command in paperspace/floating viewports and that should be it.