Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hello,
We are trying to Auto Associate CAD documents (Pro/E parts) to a soft type of WTPart. According to PTC in order to accomplish this we need to compile a java class that extends from DefaultAutoAssociatePartFinderCreator.Once we have written and compiled the class to a location under codebase we must update the following preference to specify the new class: "Custom Class for Auto Associate Part". We have a sample code to accomplish this task but we are not sure exactly what need to be modified in this code to point to our specific soft type of “WTPart” which we call “HPPart”.
We are hoping that someone has already done this and can help us modify the attached code or perhaps offer the code that they are currently using. Any help will greatly be appreciated.
Thank you,
Information about AutoAssociatePartFinderCreator.java is in UsingProEwithWindchillGuide - 'Customizing Auto Associate' section.
public WTPart createNewWTPart(EPMDocument epmDoc, String partNumber, String partName, PartType partType, String folderOID, EPMWorkspacecurrentWS, WTOrganization org, Source source, QuantityUnit defaultUnits)
below is an example implementation is for code to be included in createNewWTPart(..) method is mentioned below. You may have to manipulate it to get it working.
WTPart newp = super.createNewWTPart(epmDoc, partNumber, partName, partType, folderOID, currentWS, org, source, defa);
String SOFT_TYPE = "wt.part.WTPart|com.ptc.SodtPart";
TypeDefinitionReference typref = TypedUtilityServiceHelper.service.getTypeDefinitionReference(SOFT_TYPE);
newp = TypedUtilityServiceHelper.service.setTypeDefinitionReference(typref);
}
Also see attached sample java file.
Hope this helps !!!
Thanks,