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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Translate the entire conversation x

Easier way to iterate CAD Documents

HR_10750679
12-Amethyst

Easier way to iterate CAD Documents

Hello Community,

 

I am looking for a quicker way to iterate an object to a specific iteration. For example, if the CAD document is in A.1 version, I want to iterate it to A.7. Instead of doing a check-out and check-in 6 times, is there any better way to do it?

 

Thanks.

HS

ACCEPTED SOLUTION

Accepted Solutions

Interesting requirements, OOTB cannot achieve it, you need customization, refer to this code

API VersionControlHelper.setIterationIdentifier(Iterated iteration, IterationIdentifier identifier)

 

Demo

// iterate part from A.1 to A.5
WTPart newPart = (WTPart) VersionControlHelper.service.newIteration( part, true );
//Refresh the old iteration
part = (WTPart)PersistenceHelper.manager.refresh(part);
//Build the relationship between the new and old iteration
newPart =(WTPart)VersionControlHelper.service.supersede(part, newPart);
//Set the iterationIdentifier of new iterations
VersionControlHelper.setIterationIdentifier((Iterated)newPart,IterationIdentifier.newIterationIdentifier(Series.newSeries("wt.vc.IterationIdentifier", "5")));
//Store the new iteration
PersistenceHelper.manager.store(newPart);

View solution in original post

2 REPLIES 2

Interesting requirements, OOTB cannot achieve it, you need customization, refer to this code

API VersionControlHelper.setIterationIdentifier(Iterated iteration, IterationIdentifier identifier)

 

Demo

// iterate part from A.1 to A.5
WTPart newPart = (WTPart) VersionControlHelper.service.newIteration( part, true );
//Refresh the old iteration
part = (WTPart)PersistenceHelper.manager.refresh(part);
//Build the relationship between the new and old iteration
newPart =(WTPart)VersionControlHelper.service.supersede(part, newPart);
//Set the iterationIdentifier of new iterations
VersionControlHelper.setIterationIdentifier((Iterated)newPart,IterationIdentifier.newIterationIdentifier(Series.newSeries("wt.vc.IterationIdentifier", "5")));
//Store the new iteration
PersistenceHelper.manager.store(newPart);

avillanueva
22-Sapphire III
(To:HR_10750679)

Why would you do this? What's the use case here? Iterations are meant to just track interim edits. For example, purging can wipe them all out since previous iterations should have no consequence over time. The iteration number should not matter.

Announcements

Top Tags