This method return the path of existing component. Generally we use to to create a component resource path of files. See below example:
// Return path of updates.phtml. Elements folder must create in component folder.
$this->attachMyPath('elements/updates.phtml')