The code below sometimes returns an incorrect .viewCenter() point. As I understand it, these should be the same values as in the View section in the properties palette.
I am attaching a file where this problem occurs.
from pyrx_imp import Db, Ed, Ge
def PyRxCmd_doit():
status, ent_id, *_ = Ed.Editor.entSel("Select viewport: ")
if not status == Ed.PromptStatus.eOk:
return
vp = Db.Viewport(ent_id)
coords = (*vp.viewCenter().toTuple(), 0.0)
print(coords)
point = Db.Point(Ge.Point3d(*coords))
Db.curDb().addToModelspace(point)

viewport_bug.zip