[Advanced] Use a point monitor to add items to the hover tooltip
import traceback
from pyrx import Rx, Ge, Gi, Db, Ap, Ed
print("added command pymon")
print("added command pyunmon")
# Adds the monitors to the application
def OnPyInitApp():
PyRxCmd_pymon()
def OnPyUnloadApp():
PyRxCmd_pyunmon()
# https://help.autodesk.com/view/OARX/2025/ENU/?guid=GUID-BBDA79D3-A509-4C96-966E-72592BD32ACD
class MyPointMonitor(Ed.InputPointMonitor):
def __init__(self):
Ed.InputPointMonitor.__init__(self)
def monitorInputPoint(self, input: Ed.InputPoint, output: Ed.InputPointMonitorResult):
try:
ents = input.pickedEntities()
geo: Gi.Geometry = input.drawContext().geometry()
if len(ents) == 0:
geo.text(input.rawPoint(), Ge.Vector3d.kZAxis, Ge.Vector3d.kXAxis, 10.0, 1.0, 0, "Cold")
output.setAdditionalTooltipString("COLD")
else:
geo.text(input.rawPoint(), Ge.Vector3d.kZAxis, Ge.Vector3d.kXAxis, 10.0, 1.0, 0, "Hot")
output.setAdditionalTooltipString("HOT")
except Exception as err:
print(err)
# global space
pm = MyPointMonitor()
def PyRxCmd_pymon():
try:
manager = Ap.curDoc().inputPointManager()
manager.addPointMonitor(pm)
except Exception as err:
print(err)
def PyRxCmd_pyunmon():
try:
manager = Ap.curDoc().inputPointManager()
manager.removePointMonitor(pm)
except Exception as err:
print(err)
Screen Recording 2025-06-20 102115.mp4