API to attach (txt, xml..etc) as attachments to EPMDocument
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
API to attach (txt, xml..etc) as attachments to EPMDocument
Hi,
Is anyone aware of how to programmatically attach the files (xml, txt) etc to the CAD Attachments section??
Thanks
Solved! Go to Solution.
- Labels:
-
API
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
See the following discussion - "How to programatically add a document to attachments section?": https://community.ptc.com/t5/Windchill/How-to-programatically-add-a-document-to-attachments-section/td-p/801940
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
See the following discussion - "How to programatically add a document to attachments section?": https://community.ptc.com/t5/Windchill/How-to-programatically-add-a-document-to-attachments-section/td-p/801940
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I've written utilities that can both attach and remove attachments from EPMDocuments. The remove does it without iterating the EPMDocument. So yes, this is doable.
How about posting more specifics regarding how EXACTLY you would like this to work? Is this something a user is doing from the WIndchill UI? Is it something and admin is doing without the Windchill UI? What's the use case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @JM_10276355,
The following code snippet can be used to update the content.
ApplicationData appData = ApplicationData.newApplicationData((FormatContentHolder) epmDocument);
appData.setRole(ContentRoleType.SECONDARY);
appData = ContentServerHelper.service.updateContent(epmDocument, appData, "file.txt");