Skip to main content
1-Visitor
December 22, 2014
Solved

How to get the Product Type using Windchill API

Hello team,

Can any one help me how I can get the Type of PDMLinkProduct using Windchill API.

I have created a Product softtype using type and attribute manager wt.pdmlink.PDMLinkProduct|com.company.testProduct and I want to create it using the Windchill API but I am not sure how to set the type of the object can any one help me in this.

1-Visitor
December 28, 2014

The following piece of code might help here.

TypeDefinitionReference typeDefRef1 = TypedUtilityServiceHelper.service.getTypeDefinitionReference(objType);

PDMLinkProduct p = PDMLinkProduct.newPDMLinkProduct();

p.setTypeDefinitionReference(typeDefRef1);

3 replies

1-Visitor
December 28, 2014

The following piece of code might help here.

TypeDefinitionReference typeDefRef1 = TypedUtilityServiceHelper.service.getTypeDefinitionReference(objType);

PDMLinkProduct p = PDMLinkProduct.newPDMLinkProduct();

p.setTypeDefinitionReference(typeDefRef1);

Translate
1-Visitor
December 28, 2014

See CS135663 for information on API used for IBA.

Translate
1-Visitor
December 31, 2014

Hi Aniket,

Follow this article

http://maheshmhetre.blogspot.com/2014/07/soft-type-how-to-get-type-definition.html

Below code snippet may help you

TypeDefinitionReference typeDefRef = TypedUtility.getTypeDefinitionReference("com.maheshmhetre.epmdoc.TestEPMDocument");

if (typeDefRef != null) {

typeDefRef.getKey().getId()));

}

Translate