Hi, as far as I remember (meaning this friday) I have been solving the very same issue! This is is how I done it:
var groupedAttachment = DocumentHelper.AddGroupedAttachment(node, newAttachmentGuid, attachmentGroupGuid, filePath, treeProviderObject, width, height, maxWidth); // last three args can be set to defaults
Documenthelper automatically sets your attachmentname by the filename, so now you must rename it:
groupedAttachment.AttachmentName = "your favorite attachment name";
finally, you have to update that attachment. I don't exactly remember, but this should probably be it:
AttachmentInfoProvider.SetAttachmentInfo(groupedAttachment);
I will verify this solution on Monday though.
Best regards,
Pavel Janecka