Note that I haven't tested it with multiple prims selected, but it at least fits a few use cases.
I may add a variation of it to a right-click menu just for easy setting vs worrying about adding a python script directly to a parm expression.
from pxr import UsdGeom node = hou.pwd() # Get the stage of the input node to avoid recursion stage = node.input(0).stage() if stage is not None: # Other nodes might need "primpath", but you could functionally add any prim path you want here focusprim = stage.GetPrimAtPath(node.evalParm("primpattern")) if focusprim is not None: cache = UsdGeom.BBoxCache(1.0, ['default', 'proxy', 'render', 'guide']) bounds = cache.ComputeLocalBound(focusprim).ComputeCentroid() # node.parmTuple("p").set(bounds) crashed Houdini via recursion, but this seems to work. node.parm("py").set(bounds[1]) node.parm("pz").set(bounds[2]) return bounds[0]