Skip to main content
1-Visitor
January 26, 2022
Question

How to Get Project documents and share new documents programmatically

  • January 26, 2022
  • 1 reply
  • 1364 views

Hello everyone,

This is Windchill API-related.

 

I am trying to get a Project2 object and try to get all its documents/parts that are shared.

And also try to share/unshare their associated documents. 

 

Doing all of these programmatically through Java code but I can not find the method to do all of these.

 

Any help or suggestions? Thank you!

 

This is my code:

 

String oid = "project oid";
try {
//Get document (WTDocument)
ReferenceFactory referencefactory = new ReferenceFactory();
WTReference wtreference = (WTReference) referencefactory.getReference(oid);

if (wtreference != null) {
// If wtreference exists.

Project2 project = (Project2) wtreference.getObject();
WTContainerRef ref = (WTContainerRef) referencefactory.getReference(oid);

} else{
// If wtfreference not exists.
}
} catch ( WTException ex ) {
System.out.println("Exception: " + ex);
}

 

1 reply

joe_morton
18-Opal
18-Opal
June 3, 2022

Any luck with this? 

I was looking into this too, and found this: https://www.ptc.com/en/support/article/cs129540

It looks like there is no supported API.