Hello,
I have created a WTPart using Java code + Windchill API's. There are setter methods available for setting some attribute like Name, Number, Type, Source etc.
Is there any method / API to set the Version and Iteration of the created part through code ? Can I set the values of Version and Iteration to be say, C and 5 directly ? Or creating a default Part of A.1 and revising / checking out is the only option ?
It would be really helpful if someone could help me with Windchill API's / Code snippets to set Part Version / Iteration OR Revise / Check out a part till the desired Version / Iteration is reached.
Solved! Go to Solution.
Yes, it is possible to load objects out of sequence. For setting the version one can use VersionControlSErverHerlper API's as shown below.
VersionIdentifier vid = VersionIdentifier.newVersionIdentifier();
VersionControlServerHelper.setVersionIdentifier(the_versioned, vid, false /* validateIncreasing */);
Similarly for iteration one can use IterationIdentifier API's. As shown below
IterationIdentifier iid = IterationIdentifier.newIterationIdentifier();
VersionControlHelper.setIterationIdentifier(the_iterated, iid);
A detailed code snippet can be found at <WT_HOME>\src\com\wt\doc\LoadDoc.java
-Malavika
Similar question and answer for that is posted @ http://ezcollab.com/questions/341/how-to-set-part-attributes-version-iteration-using-code-windchill-apis
Hi,
I wanted to assign version of EPMDoc object to WTDoc object while creation WTDoc.
Suppose EPMDoc has version A then WTDoc of same version should create in system.
is it possible?if so then plz let me know how i can achieve this through code.
Yes, it is possible to load objects out of sequence. For setting the version one can use VersionControlSErverHerlper API's as shown below.
VersionIdentifier vid = VersionIdentifier.newVersionIdentifier();
VersionControlServerHelper.setVersionIdentifier(the_versioned, vid, false /* validateIncreasing */);
Similarly for iteration one can use IterationIdentifier API's. As shown below
IterationIdentifier iid = IterationIdentifier.newIterationIdentifier();
VersionControlHelper.setIterationIdentifier(the_iterated, iid);
A detailed code snippet can be found at <WT_HOME>\src\com\wt\doc\LoadDoc.java
-Malavika