cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

How to Get Project documents and share new documents programmatically

WV_10110649
5-Regular Member

How to Get Project documents and share new documents programmatically

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 1

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. 

Top Tags