-add point attribute
geo.addAttrib(hou.attribType.Point, "name", "")
-add Global or detail attribute
geo.addAttrib(hou.attribType.Global, "id", number)
-----------------------------------------
--add and set "name" attribute ex--
node = hou.pwd()
geo = node.geometry()
geo.addAttrib(hou.attribType.Point, "name", "")
for point in geo.points():
point.setAttribValue("name", "piece" + str(point.number()))
-----------------------------------------
https://forums.odforce.net/topic/31951-add-name-attribute-via-python/
-----------------------------------------
###memo: my cord
node = hou.pwd()
geo = node.geometry()
# Add code to modify contents of geo.
# Use drop down menu to select examples.
#t = target_node.inputs()
#for i in t:
# name = i.path()
# get_name = name.split("_")
# print name
# geo = hou.node(name).geometry()
thenumber = int(node.evalParm('opdigits'))
# geo.addAttrib(hou.attribType.Global, "pos_id", thenumber)
geo.addAttrib(hou.attribType.Point, "pos_id", thenumber)