def toComponentMObject( dagPath ):
    
    component = MObject()
    sel = MSelectionList()
    mit = MItGeometry( dagPath )
    while not mit.isDone():
        # MItGeometry.component is deprecated
        comp = mit.currentItem()
        # merge is True
        sel.add( dagPath, comp, True )
        mit.next()
    sel.getDagPath( 0, dagPath, component )
    return component
      
# MDagPath, MPlug or MObject to name
# Note there is a kNamedObject API type but not corresponding MFn, thus
# I see no way of querying the name of something that isn't a kDependency node or a MPlug
# TODO : add components support, short/ long name support where applies
Append message to mailbox and return (start, stop) offsets.
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.3/pymel/api/allapi.py/toComponentMObject--crossover with--dataset/ETHPy150Open babble/babble/include/jython/Lib/mailbox.py/_singlefileMailbox._append_message