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

Reg:- Creation of Soft Attribute Object through code in Windchill

Highlighted
Newbie

Reg:- Creation of Soft Attribute Object through code in Windchill

Hi,



I need to create a soft Object through code in Windchill. Any pointers to the same

P.Karthick



3 REPLIES 3

Reg:- Creation of Soft Attribute Object through code in Windchill

Hi Karthick,
Here is some of the *Typed *related api that can get you started.

*import wt.type.TypeDefinitionReference;
import wt.type.TypedUtilityServiceHelper;
import wt.type.Typed;
import com.ptc.core.meta.common.impl.WCTypeIdentifier;
import com.ptc.core.meta.server.TypeIdentifierUtility;*

TypeDefinitionReference typeDefRef =
TypedUtilityServiceHelper.service.getTypeDefinitionReference(objectType);

Typed typedobj;

typedObj.setTypeDefinitionReference(typeDefRef);

String type = ((WCTypeIdentifier)
TypeIdentifierUtility.getTypeIdentifier(typedObj)).getTypename();


Regards,
Prathap

On Mon, Jun 30, 2008 at 2:39 AM, Karthick Perumal Pillai <
karthick.perumalpillai@tcs.com> wrote:

> Hi,
>
>
>
> I need to create a soft Object through code in Windchill. Any pointers to
> the same
>
> P.Karthick
>
>
>

Reg:- Creation of Soft Attribute Object through code in Windchill

Karthick -



You may also need this once your type is defined.



IBADefinitionHelper.service.createAttributeDefinition(AttributeDefDefaultVie
w arg0)







To create the object - check out how the GUI does it - this is most likely
the class:



com.ptc.core.meta.type.admin.server.impl.StandardTypeAdminService.newStandar
dTypeAdminService().createTypeNode(TypeDefinitionNodeView arg0, Locale
arg1);



which calls:



public TypeDefinitionNodeView createTypeNode(String s,
TypeDefinitionNodeView typedefinitionnodeview, Locale locale)

throws RemoteException, NotAuthorizedException,
WTContainerException, WTException

{





This class also has method for updating existing ones and handling the
checkin and checkout, etc.



Not tried to see if this works but this be a pointer in that direction.



Let us know if you get it working.





HTH,

David DeMay







_____

Reg:- Creation of Soft Attribute Object through code in Windchill

or you could just fetch ext.tools from pdmteam.com and use the
UpdateIBAs class (or parts ot the code)
also using the create-objects webject would be an option.

martin

David DeMay wrote:
>
> Karthick -
>
>
>
> You may also need this once your type is defined…
>
>
>
> IBADefinitionHelper.service.createAttributeDefinition(AttributeDefDefaultView
> arg0)
>
>
>
>
>
>
>
> To create the object – check out how the GUI does it – this is most
> likely the class:
>
>
>
> com.ptc.core.meta.type.admin.server.impl.StandardTypeAdminService.newStandardTypeAdminService().createTypeNode(TypeDefinitionNodeView
> arg0, Locale arg1);
>
>
>
> which calls:
>
>
>
> public TypeDefinitionNodeView createTypeNode(String s,
> TypeDefinitionNodeView typedefinitionnodeview, Locale locale)
>
> throws RemoteException, NotAuthorizedException,
> WTContainerException, WTException
>
> {
>
>
>
>
>
> This class also has method for updating existing ones and handling the
> checkin and checkout, etc.
>
>
>
> Not tried to see if this works but this be a pointer in that direction.
>
>
>
> Let us know if you get it working.
>
>
>
>
>
> HTH,
>
> David DeMay
>
>
>
>
>
>
>
Announcements
LiveWorx Call For Papers Happening Now!