Change name of a subtype through code

1160
2
Jump to solution
07-26-2016 10:19 PM
Highlighted
New Contributor III

I want to change the name of a feature class subtype using ArcObjects (subtype code will remain the same).  The feature class is part of a geometric network so I don't want to delete and recreate it as it has connectivity rules associated with it.  On the ISubtypes interface the Subtypes and SubtypeName properties are read-only.

The name can be changed manually through the interface in ArcCatalog but this is required for a script to progress schema changes through dev, test, prod environments.

It can be achieved through a complete hack of the GDB_ITEMS table using the SQL below but I don't really want to go there.

UPDATE SDE.GDB_ITEMS

SET Definition.modify('replace value of (//DEFeatureClassInfo/Subtypes/Subtype[SubtypeCode=70301]/SubtypeName/text())[1] with ("Inverter Location")')

WHERE NAME = 'Electricity.ArcFM.Inverter'

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Regular Contributor

Neil,

There's no way to change the description of an existing subtype in ArcObjects. Catalog makes the change by deleting and re-adding the subtype that has been modified.

View solution in original post

Reply
0 Kudos
2 Replies
Highlighted
Esri Regular Contributor

Neil,

There's no way to change the description of an existing subtype in ArcObjects. Catalog makes the change by deleting and re-adding the subtype that has been modified.

View solution in original post

Reply
0 Kudos
Highlighted
New Contributor III

Thanks Sean.  Based on your advice regarding how ArcCatalog performs the rename I checked to see if the geometric network connectivity rules for this subtype were preserved.  Sadly they are not.  This class is not involved in a relationship but I would assume relationship rules would also be lost.

Reply
0 Kudos