Hmm, ok that is indeed a long way to go.
Now how to start... :-?
You now have an Object o, but I guess you really need an EA.Element. In that case you'll have to test if your o is of type EA.Element, and then cast it.
Something like:
if (o is EA.Element)
{
EA.Element selectedElement = (EA.Element)o;
}
So that's better already, you now have selectedElement of type EA.Element.
Then you might want to create a new element to copy to.
I'm not sure anymore if there are any 'clone' operations available in the API, you might want to search the forum for it.
But if you would want to copy your element manually you need a package or other element to add the new element to.
Suppose you want to add the element to the same package then you would need to do something like:
EA.Package parentPackage = Repository.GetPackageByID(selectedElement.PackageID);
EA.Element elementCopy = parentPackage.Elements.AddNew(selectedElement.Name + "_copy", selectedElement.ObjectType);
That gives you a copy of the Element. Now you need to copy the properties you need to your copy element (think stereotype, state, phase,etc...)
And then you might want to copy the features such as attributes.
To do this you need to loop the existing attributes and create a new attribute for each one of them something like:
foreach (EA.Attribute attribute in selectedElement.Attributes)
{
elementCopy.Attributes.AddNew(attribute.Name + "_copy", "Attribute);
}
And then of course don't forget to copy the other properties of your attributes.
I hope this helps. I have some more EA addin tutorials on my blog:
http://geertbellekens.wordpress.com/ and a whole lot of example code on github:
https://github.com/GeertBellekens/Geert
PS. I haven't syntax checked the example code above, might not compile like that.