Skip to main content
14-Alexandrite
September 25, 2025
Question

Is there any Available Code to Delete Global Attribute from Softtype?

  • September 25, 2025
  • 3 replies
  • 872 views

Version: Windchill 12.1

 

Use Case: At the time of migration, we have used few attributes which are used at the time of migration, now they are not at all needed, Since there are many, we need to delete in Bulk.


Description:

At the time of migration, we have used few attributes which are used at the time of migration, now they are not at all needed, Since there are many, we need to delete attributes in Bulk from.

  1. SoftType
  2. Manage Reusable Attributes.

3 replies

Fadel
23-Emerald I
September 25, 2025
HelesicPetr
22-Sapphire II
22-Sapphire II
October 22, 2025

Hi @Fadel 

It is not exactly right 😄 

there is a mechanism that generates a xml for deleting a IBA  attribute from a soft type. 

during a import by loadfromfile there is information that xml for deleting is generated.

HelesicPetr_0-1761124950789.png

So you can use this xml as a template to generate own one to remove the attributes from the softtype

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE NmLoader
 SYSTEM "standard12_0.dtd">
<NmLoader>
 <csvDeleteAttributes handler="com.ptc.core.lwc.server.TypeDefinitionLoader.deleteAttributeDefinitions">
 <csvattTemplate>LWCTYPE</csvattTemplate>
 <csvtypeContext>wt.doc.WTDocument</csvtypeContext>
 <csvdefNames>DATA|java.lang.String|EN_NAME , DATA|java.lang.String|ADDITIONALINFO</csvdefNames>
 </csvDeleteAttributes>
</NmLoader>

PetrH

 

PetrH
18-Opal
September 29, 2025

@Manoj_Dokku4 

This is definitely doable.

There is no delete reusable attribute OOTB method, however, a custom Java class or sql script can be written to do this.

14-Alexandrite
October 1, 2025

@d_graham , Can you please provide me info regarding any API I can try?

18-Opal
October 12, 2025

@Manoj_Dokku4 ,

There is no OOTB API you can try.

I could certainly write the Java code to do it but I have not written it as of yet as I’ve not had any company request it.
Once a company request it, along with their exact specifications I’ll write it.

6-Contributor
October 16, 2025

Hi @Manoj_Dokku4 ,

 

If you are wanting to delete ibas from a type definition then you can do this via load from file.

Actually if you load a type definition with less attributes than what already exists in the target Windchill, Windchill will create the lwcDeleteType and lwcDeleteAttributes loadFiles automatically. You can then choose to execute those loadFiles to do the deletion. This is Windchill's way of making sure nothing is deleted that isn't really intended to be.

This example deletes attributes from 3 types.

DefaultEPM, customPart, customDoc.

the first part of the <csvdefNames> is constant, followed by a comma separated list of ibas to remove, there should be plenty of examples for different data types in the example.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE NmLoader SYSTEM "standardX26.dtd">
<NmLoader>
	<!-- EPM/CAD -->
	<csvDeleteAttributes handler="com.ptc.core.lwc.server.TypeDefinitionLoader.deleteAttributeDefinitions">
 <csvattTemplate>LWCTYPE</csvattTemplate>
 <csvtypeContext>ext.customer.DefaultEPMDocument</csvtypeContext>
 <csvdefNames>DATA|com.ptc.core.meta.common.DiscreteSet|DATA|java.lang.Boolean|false , DATA|java.lang.String|customShortDesc , DATA|java.lang.String|customGeomRestRe10 , DATA|java.lang.String|customIsGeomRestRRecE10 , DATA|java.lang.String|customScopeE10 , DATA|java.lang.String|customVoilRestrictE10 , DATA|java.lang.String|customIsDerived , DATA|java.lang.String|customIsVerified , DATA|java.lang.String|customIsInheritedDomain , DATA|java.lang.String|customShouldImport , DATA|java.sql.Timestamp|customCopyrightYear</csvdefNames>
 </csvDeleteAttributes>
	<!-- Document -->
	<csvDeleteAttributes handler="com.ptc.core.lwc.server.TypeDefinitionLoader.deleteAttributeDefinitions">
 <csvattTemplate>LWCTYPE</csvattTemplate>
 <csvtypeContext>ext.customer.customDoc</csvtypeContext>
 <csvdefNames>DATA|com.ptc.core.meta.common.DiscreteSet|DATA|java.lang.Boolean|false , DATA|java.lang.String|customShortDesc , DATA|java.sql.Timestamp|customCopyrightYear</csvdefNames>
 </csvDeleteAttributes>
	<!-- Part -->
	<csvDeleteAttributes handler="com.ptc.core.lwc.server.TypeDefinitionLoader.deleteAttributeDefinitions">
 <csvattTemplate>LWCTYPE</csvattTemplate>
 <csvtypeContext>ext.customer.customPart</csvtypeContext>
 <csvdefNames>DATA|com.ptc.core.meta.common.DiscreteSet|DATA|java.lang.Boolean|false , DATA|java.lang.String|customShortDesc , DATA|java.sql.Timestamp|customCopyrightYear</csvdefNames>
 </csvDeleteAttributes>
</NmLoader>

 

 

to delete the attribute entirely from the Reusable Attributes Manager you could write a custom loader to achieve this or a standalone java utility to be executed from the windchill shell if you have shell access.
I would start looking at the OOTB DefinitionLoaderWithCache attribute loader if creating a custom loader.

Mind you that's not a supported API.

 

Community Manager
October 22, 2025

Hello @Manoj_Dokku4

 

It looks like you have some responses from some community experts. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.