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

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

Auto Associate CAD Document (Pro/E Object) to a WTPart soft type

ptc-127772
1-Newbie

Auto Associate CAD Document (Pro/E Object) to a WTPart soft type

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,

4 REPLIES 4

No code needed. In 10.1 there is a property on EPMDocument called Default Type of Part to Create. Set this to your soft type and you're done.

Thanks,
Patrick Williams

On Oct 21, 2013, at 3:24 PM, "Ali Bashiri" <-<<a style="COLOR:" blue;=" text-decoration:=" underline&quot;=" target="_BLANK" href="mailto:-">>">mailto:->> wrote:


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,

Sorry, I forgot to mention that we are still on PDMLink 9.1 M070.

Ali Bashiri |Hewlett-Packard |Tel:281-514-4922 | Email: -

Ali,



Have you compiled this code you attached and set the preference to execute
it?



I can help you if you still need help. Really all you need to do is pass a
string representation of the soft type identifier, the rest should work from
there.



Any soft attributes on the part have to be handled separately. I do not
recollect if WTPartUtilities.createNewPart persists the part to the database
or if this occurs in the super class
(DefaultAutoAssociatePartFinderCreator).



Regards,

David








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,

Top Tags