selpath = hou.hscriptExpression('mousepath()').split('.')[-1] voppath = '/'.join( selpath.split('/')[:-1] ) node = hou.node(voppath) retval, aname = hou.ui.readInput("Attribute Name", buttons=('OK',)) if retval != -1: add = node.createNode('addattrib') add.setName("add_%s"%aname) add.parm('attrib').set(aname) add.parm('localvar').set(aname.upper()) if aname == 'orient': add.parm('typemodifier').set('quaternion')