Community Tip - You can change your system assigned username to something more personal in your community settings. X
Hi
i'm trying to build an Creo utility that adds "non latest" version of epmdoc to WS.
Unfortunately, this is not supported through the toolkit - as specified in Article - CS7762
So, i'm thinking to add epmdoc to WS using Windchill api first and then connect to relevant WS using Creo API.
did any of you tried this approach ? any other suggestions/ideas ?
i'm planning to facilitate AddToWorkspaceAction for that.
Many thanks,
What is the ultimate goal? Are you trying to load data and control some pre-existing as-stored history? I have not tried this approach but it is possible to load older iterations and versions to a workspace. The normal UI allows for download of non-latest versions but there will be a check to verify you want to replace the existing version if it already exists in the workspace. Seems like a lot of work, especially if you want to use this all the time.
Hi,
I'm implementing now DrawingValidator byElysium Software, which is btw great product for comparing drawings & geometry, and though it would be VERY beneficial, process vise, to add the drawing comparison result to promotion/ECN approval process. so the approver can see the report and skip the tedious process of looking for the changes.
in order to do the comparison i need to get the previous RELEASED/APPROVED version of the model/drawing, and comparing it to new one.
Getting the new one, latest, was quite easy. however, getting the old one seems like a real challenge...
and here i'm looking for the community assistance
What if you published a PDF at each release, then just compare PDFs? I would think it would be easier to manage 1 PDF for future comparisons then trying to get all the correct references historically.
using pdf for comparison is lacking the functionality existed in DrawingValidator byElysium Software which we found to be superior to any product/method out-there.
BTW, as we intent to create their special format, EPF, on each check in, in the future we will use your technique. however, there is still a gap of 2-3 year by then...
Hi @Rami_Noah
Check the wt.vc.config.ConfigSpec interface
there is a subclass wt.epm.workspaces.EPMAsStoredConfigSpec that can be used for the query
here is example how to use it
EPMDocument epmDoc = null; // null is just for usage purpose you need to search your assembly iteration to get as stored config.
List<ConfigSpec> configSpecList = new ArrayList<ConfigSpec>();
EPMAsStoredConfigSpec epmAsStoredConfig = EPMAsStoredConfigSpec.newEPMAsStoredConfigSpec(epmDoc.getAsStoredConfig());
configSpecList.add(epmAsStoredConfig);
QueryResult qr = ConfigHelper.service.filteredIterationsOf(epmDoc.getMaster(), configSpecList);
PetrH
thank you for you suggestion.
i'll verify that soon
you can see below the relevant code :
public static WTCollection collectItemsForWorkspace(EPMDocument theDraw) throws WTException, WTPropertyVetoException {
WTCollection myResult = new WTArrayList();
// Definitions/setup
WTCollection seeds = new WTArrayList();
Collection<?> result = new WTArrayList();
EPMDocConfigSpec configSpec = new EPMDocConfigSpec();
configSpec.setAsStoredActive(true);
NavigationCriteria nc = NavigationCriteria.newNavigationCriteria();
List<EPMDocConfigSpec> configpecs = new ArrayList<>();
// Collect Items
seeds.add(theDraw);
logger.debug("Seed is: "+theDraw.getNumber()+" "+theDraw.getName());
EPMAsStoredConfigSpec asStored = EPMAsStoredConfigSpec.newEPMAsStoredConfigSpec(theDraw);
EPMDocConfigSpec epmAsStoredConfig = EPMDocConfigSpec.newEPMDocConfigSpec(asStored);
//Bug Correction for EPMDocs that does not have As Stored Config Spec - PTC Case C12869402
if (asStored == null) {
configSpec.setLatestActive();
configpecs.add(configSpec);
logger.debug("Seed is: "+theDraw.getNumber()+" "+theDraw.getName()+" LATEST Config Spec");
} else {
configSpec.setAsStoredConfig(asStored);
configpecs.add(epmAsStoredConfig);
logger.debug("Seed is: "+theDraw.getNumber()+" "+theDraw.getName()+" AS STORED Config Spec");
}
// Navigation Criteria
nc.setConfigSpecs(configpecs);
// Collect items
//CadCollectedResult ccr = CadCollector.newInstance(seeds, nc).dependents(GatherDependents.ALL).familyGenerics(GatherFamilyGenerics.ALL).familyMembers(GatherFamilyMembers.ALL).drawings(CadCollector.GatherDrawings.ALL).collect();
CadCollectedResult ccr = CadCollector.newInstance(seeds, nc).dependents(GatherDependents.ONLY_REQUIRED).collect();
result = (Collection<?>) ccr.getCollectedObjects();
logger.debug("collectItemsForWorkspace - Number of objects Collected : " + result.size());
for (Object obj : result) {
logger.trace("collectItemsForWorkspace - obj: "+obj);
if (obj instanceof EPMDocument) {
EPMDocument epm = (EPMDocument)obj;
logger.trace("collectItemsForWorkspace - collected: "+epm.getDisplayIdentifier());
}
}
logger.debug("collectItemsForWorkspace - Added Collected EPM Docs");
WTCollection addedItems = new WTArrayList(result);
//result.addAll(partResult); - this collection gets Object Reference
Iterator<?> items = result.iterator();
while (items.hasNext()) {
Object item = items.next();
if (item instanceof EPMDocument) logger.trace("collectItemsForWorkspace - Related CAD object : " + ((EPMDocument)item).getNumber()+" "+((WTObject)item).getDisplayIdentity());
if (item instanceof WTPart) logger.trace("collectItemsForWorkspace - WTPart object : " + ((WTPart)item).getNumber()+" "+((WTObject)item).getDisplayIdentity());
}
myResult = addedItems;
return myResult;
}